UNPKG

luxon-parser

Version:

Add DateTime.fromHuman() and DateTime.fromAny() functions to Luxon that can parse a wide range of date formats including human-input dates

27 lines (23 loc) 963 B
// Generated by dts-bundle-generator v9.5.1 import { DateTime } from 'luxon'; import { DateObjectUnits, DateTimeOptions } from 'luxon/src/datetime'; /** * Create a DateTime from any given String * Equivalent to auto choosing the right from*() function: * DateTime.fromFormat() * DateTime.fromHTTP() * DateTime.fromISO() * DateTime.fromRFC2822() * DateTime.fromSQL() * DateTime.fromString() * @param string Any parseable string * @param options Luxon options you would normally pass as a second argument */ export declare function dateTimeFromHuman(string: string, options?: DateTimeOptions): DateTime; /** * Create a DateTime from any given type * @param [date] Something that can be converted to a date * @param [options] Luxon options you would normally pass as a second argument */ export declare function dateTimeFromAny(date?: null | string | DateTime | Date | number | DateObjectUnits, options?: DateTimeOptions): DateTime; export {};