All files / packages/ui/src/components/DatePicker constants.ts

100% Statements 9/9
100% Branches 0/0
100% Functions 0/0
100% Lines 9/9

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    5x   5x         5x         5x           5x         5x   5x               5x         5x          
import type { DatePickerTimeSlot, DateRangeValue } from "./types";
 
export const DAY_IN_MS = 24 * 60 * 60 * 1000;
 
export const DATE_PICKER_MODE = {
  SINGLE: "single",
  RANGE: "range",
} as const;
 
export const DATE_PICKER_RANGE_SELECTION = {
  START: "start",
  END: "end",
} as const;
 
export const DATE_PICKER_TIME_SLOT = {
  ALL_DAY: "all_day",
  MORNING: "morning",
  AFTERNOON: "afternoon",
} as const;
 
export const DATE_PICKER_MODE_TYPE = {
  DATE_ONLY: "date_only",
  DATE_WITH_TIME_OFF: "date_with_time_off",
} as const;
 
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",
};