UNPKG

@equinor/eds-core-react

Version:

The React implementation of the Equinor Design System

9 lines (6 loc) 334 B
import { toCalendarDateTime, fromDate, toCalendarDate } from '@internationalized/date'; const getCalendarDate = (value, timezone, showTimeInput = false) => { if (!value) return null; return showTimeInput ? toCalendarDateTime(fromDate(value, timezone)) : toCalendarDate(fromDate(value, timezone)); }; export { getCalendarDate };