1 | import { createLocalOrUTC } from './from-anything';
|
2 | import { isDate } from '../utils/type-checks';
|
3 | export function parseDate(input, format, localeKey, strict, isUTC) {
|
4 | if (isDate(input)) {
|
5 | return input;
|
6 | }
|
7 | const config = createLocalOrUTC(input, format, localeKey, strict, isUTC);
|
8 | return config._d;
|
9 | }
|
10 | export function utcAsLocal(date) {
|
11 | if (!(date instanceof Date)) {
|
12 | return null;
|
13 | }
|
14 | return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
|
15 | }
|
16 |
|
\ | No newline at end of file |