UNPKG

@wordpress/components

Version:
19 lines (17 loc) 370 B
/** * External dependencies */ import { toDate } from 'date-fns'; /** * Like date-fn's toDate, but tries to guess the format when a string is * given. * * @param input Value to turn into a date. */ export function inputToDate(input) { if (typeof input === 'string') { return new Date(input); } return toDate(input); } //# sourceMappingURL=utils.js.map