terriajs
Version:
Geospatial data visualization platform.
16 lines • 957 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { formatDateTime } from "../DateFormats";
import * as DTP from "./DateTimePickerStyles";
import { monthNames } from "./utils";
export const HourView = ({ year, month, day, datesObject, onSelectHour }) => {
const dayData = datesObject;
const timeOptions = dayData.dates.map((m) => ({
value: m,
label: formatDateTime(m)
}));
if (timeOptions.length <= 24) {
return null;
}
return (_jsxs(DTP.Grid, { children: [_jsx(DTP.GridHeading, { children: `Select an hour on ${day} ${monthNames[month + 1]} ${year}` }), _jsx(DTP.GridBody, { children: dayData.index.map((hour) => (_jsxs(DTP.DateButton, { onClick: () => onSelectHour(hour), children: [_jsxs("span", { children: [hour, " : 00 - ", hour + 1, " : 00"] }), " ", _jsxs("span", { children: ["(", dayData[hour].length, " options)"] })] }, hour))) })] }));
};
//# sourceMappingURL=HourView.js.map