@equinor/eds-core-react
Version:
The React implementation of the Equinor Design System
9 lines (6 loc) • 334 B
JavaScript
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 };