Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | 8x 8x 8x 8x 8x 8x 8x 8x 8x | import {
DATE_PICKER_MODE,
DATE_PICKER_MODE_TYPE,
DATE_PICKER_RANGE_SELECTION,
DATE_PICKER_TIME_SLOT,
} from "@repo/constants";
import type { DatePickerTimeSlot, DateRangeValue } from "./types";
export {
DATE_PICKER_MODE,
DATE_PICKER_RANGE_SELECTION,
DATE_PICKER_TIME_SLOT,
DATE_PICKER_MODE_TYPE,
};
export const DAY_IN_MS = 24 * 60 * 60 * 1000;
// react-native-ui-datepicker always derives each day cell's height as
// (containerHeight - weekdaysHeight) / 6, regardless of how many rows the
// displayed month actually needs — the divisor is hardcoded to 6 internally,
// it is NOT the actual row count. So containerHeight must stay anchored to a
// fixed 6-row span (otherwise cell height drifts and circles turn oval); we
// derive that span from the calendar's measured width so cells stay square,
// and separately collapse the leftover space for months with fewer rows via
// a negative margin (see calendarGapOffset in index.tsx).
export const DATE_PICKER_DEFAULT_WEEKDAYS_HEIGHT = 25;
export const DATE_PICKER_RESERVED_ROWS = 6;
export const DATE_PICKER_COLUMNS = 7;
export const DATE_PICKER_FALLBACK_CELL_SIZE =
(300 - DATE_PICKER_DEFAULT_WEEKDAYS_HEIGHT) / DATE_PICKER_RESERVED_ROWS;
export const DATE_PICKER_NO_DATE_SELECTED = "No date selected";
export const EMPTY_RANGE: DateRangeValue = {
startDate: null,
endDate: null,
};
export const TIME_SLOT_OPTIONS: ReadonlyArray<{
label: string;
value: DatePickerTimeSlot;
}> = [
{ label: "Morning", value: DATE_PICKER_TIME_SLOT.MORNING },
{ label: "Afternoon", value: DATE_PICKER_TIME_SLOT.AFTERNOON },
];
export const TIME_SLOT_LABEL: Record<DatePickerTimeSlot, string> = {
[DATE_PICKER_TIME_SLOT.ALL_DAY]: "All day",
[DATE_PICKER_TIME_SLOT.MORNING]: "Morning",
[DATE_PICKER_TIME_SLOT.AFTERNOON]: "Afternoon",
};
|