@date-io/core
Advanced tools
Comparing version 2.17.0 to 3.0.0
@@ -69,7 +69,11 @@ export interface DateIOFormats<TLibFormatToken = string> { | ||
export interface ExtendableDateType {} | ||
type ConstructorOptions<TLocale> = { | ||
formats?: Partial<DateIOFormats>; | ||
locale?: TLocale; | ||
instance?: any; | ||
}; | ||
export interface IUtils<TDate extends ExtendableDateType> { | ||
export interface IUtils<TDate, TLocale> { | ||
formats: DateIOFormats<any>; | ||
locale?: any; | ||
locale?: TLocale; | ||
moment?: any; | ||
@@ -80,5 +84,26 @@ dayjs?: any; | ||
// constructor (options?: { formats?: DateIOFormats, locale?: any, instance?: any }); | ||
// Constructor type | ||
// new (options?: { | ||
// formats?: Partial<DateIOFormats>; | ||
// locale?: TLocale; | ||
// instance?: any; | ||
// }): IUtils<TDate, TLocale>; | ||
date(value?: any): TDate | null; | ||
/** | ||
* Creates a date object. Use `utils.date()` to create a new date object of the underlying library.` | ||
* Supports some of the standard input sources like ISO strings so you can pass the string directly | ||
* as `utils.date("2024-01-10T14:30:00Z"), and javascript `Date` objects `utils.date(new Date())`. | ||
* | ||
* if `null` is passed `null` will be returned. | ||
*/ | ||
date< | ||
TArg extends unknown = undefined, | ||
TResultingDate extends unknown = TArg extends null | ||
? null | ||
: TArg extends undefined | ||
? TDate | ||
: TDate | null | ||
>( | ||
value?: TArg | ||
): TResultingDate; | ||
toJsDate(value: TDate): Date; | ||
@@ -85,0 +110,0 @@ parseISO(isString: string): TDate; |
{ | ||
"name": "@date-io/core", | ||
"version": "2.17.0", | ||
"version": "3.0.0", | ||
"description": "Abstraction over common javascript date management libraries", | ||
@@ -34,3 +34,3 @@ "scripts": { | ||
}, | ||
"gitHead": "e497a04c456f04211c8b0877d002c85e72ea98a2" | ||
"gitHead": "9d304288545a0a9c9f4e3b8aefd428da3757d330" | ||
} |
10199
205