terriajs
Version:
Geospatial data visualization platform.
12 lines • 886 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import isDefined from "../../../../Core/isDefined";
import * as DTP from "./DateTimePickerStyles";
export const YearView = ({ datesObject, onSelectYear }) => {
if (!datesObject.dates || datesObject.dates.length <= 12) {
return null;
}
const years = datesObject.index;
const monthOfYear = Array.apply(null, { length: 12 }).map(Number.call, Number);
return (_jsxs(DTP.Grid, { children: [_jsx(DTP.GridHeading, { children: "Select a year" }), _jsx(DTP.GridBody, { children: years.map((y) => (_jsxs(DTP.GridRow, { onClick: () => onSelectYear(y), children: [_jsx(DTP.GridLabel, { children: y }), _jsx(DTP.GridRowInner, { marginRight: "11", children: monthOfYear.map((m) => (_jsx(DTP.GridItem, { active: isDefined(datesObject[y][m]) }, m))) })] }, y))) })] }));
};
//# sourceMappingURL=YearView.js.map