nxt-pick-datetime 17.0.1 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -53
- package/assets/picker.scss +673 -673
- package/fesm2022/nxt-pick-datetime-moment-adapter.mjs +23 -26
- package/fesm2022/nxt-pick-datetime-moment-adapter.mjs.map +1 -1
- package/fesm2022/nxt-pick-datetime-native-adapter.mjs +22 -24
- package/fesm2022/nxt-pick-datetime-native-adapter.mjs.map +1 -1
- package/fesm2022/nxt-pick-datetime.mjs +77 -75
- package/fesm2022/nxt-pick-datetime.mjs.map +1 -1
- package/lib/class/date-time.class.d.ts +1 -1
- package/moment-adapter/moment-adapter.module.d.ts +2 -0
- package/moment-adapter/public-api.d.ts +1 -1
- package/native-adapter/native-adapter.module.d.ts +2 -0
- package/native-adapter/public-api.d.ts +1 -1
- package/package.json +10 -15
- package/esm2022/lib/class/date-time-adapter.class.mjs +0 -97
- package/esm2022/lib/class/date-time-format.class.mjs +0 -4
- package/esm2022/lib/class/date-time.class.mjs +0 -95
- package/esm2022/lib/class/dialog-config.class.mjs +0 -47
- package/esm2022/lib/class/dialog-ref.class.mjs +0 -119
- package/esm2022/lib/date-time/calendar/calendar.component.mjs +0 -346
- package/esm2022/lib/date-time/calendar-body/calendar-body.component.mjs +0 -151
- package/esm2022/lib/date-time/calendar-month-view/calendar-month-view.component.mjs +0 -429
- package/esm2022/lib/date-time/calendar-multi-year-view/calendar-multi-year-view.component.mjs +0 -358
- package/esm2022/lib/date-time/calendar-year-view/calendar-year-view.component.mjs +0 -362
- package/esm2022/lib/date-time/date-time-inline/date-time-inline.component.mjs +0 -275
- package/esm2022/lib/date-time/date-time-picker/date-time-picker.component.mjs +0 -541
- package/esm2022/lib/date-time/date-time-picker-container/date-time-picker-container.animations.mjs +0 -19
- package/esm2022/lib/date-time/date-time-picker-container/date-time-picker-container.component.mjs +0 -389
- package/esm2022/lib/date-time/date-time-picker-input.directive.mjs +0 -618
- package/esm2022/lib/date-time/date-time-picker-intl.service.mjs +0 -61
- package/esm2022/lib/date-time/date-time-picker-trigger.directive.mjs +0 -70
- package/esm2022/lib/date-time/date-time.module.mjs +0 -96
- package/esm2022/lib/date-time/number-fixed-len.pipe.mjs +0 -22
- package/esm2022/lib/date-time/timer/timer.component.mjs +0 -299
- package/esm2022/lib/date-time/timer-box/timer-box.component.mjs +0 -95
- package/esm2022/lib/dialog/dialog-container/dialog-container.component.mjs +0 -248
- package/esm2022/lib/dialog/dialog.module.mjs +0 -42
- package/esm2022/lib/dialog/dialog.service.mjs +0 -251
- package/esm2022/lib/utils/object.mjs +0 -24
- package/esm2022/moment-adapter/date-time-adapter.class.mjs +0 -220
- package/esm2022/moment-adapter/date-time-format.class.mjs +0 -13
- package/esm2022/moment-adapter/moment-adapter.module.mjs +0 -37
- package/esm2022/moment-adapter/nxt-pick-datetime-moment-adapter.mjs +0 -5
- package/esm2022/moment-adapter/public-api.mjs +0 -3
- package/esm2022/native-adapter/date-time-adapter.class.mjs +0 -366
- package/esm2022/native-adapter/date-time-format.class.mjs +0 -13
- package/esm2022/native-adapter/native-adapter.module.mjs +0 -37
- package/esm2022/native-adapter/nxt-pick-datetime-native-adapter.mjs +0 -5
- package/esm2022/native-adapter/public-api.mjs +0 -2
- package/esm2022/nxt-pick-datetime.mjs +0 -5
- package/esm2022/public-api.mjs +0 -14
|
@@ -202,10 +202,10 @@ class MomentDateTimeAdapter extends DateTimeAdapter {
|
|
|
202
202
|
createMoment(...args) {
|
|
203
203
|
return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);
|
|
204
204
|
}
|
|
205
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
206
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
205
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: MomentDateTimeAdapter, deps: [{ token: LOCALE_ID, optional: true }, { token: NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
206
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: MomentDateTimeAdapter }); }
|
|
207
207
|
}
|
|
208
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
208
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: MomentDateTimeAdapter, decorators: [{
|
|
209
209
|
type: Injectable
|
|
210
210
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
211
211
|
type: Optional
|
|
@@ -232,34 +232,31 @@ const NXT_MOMENT_DATE_TIME_FORMATS = {
|
|
|
232
232
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
+
function provideMomentDateTimeAdapter() {
|
|
236
|
+
return [
|
|
237
|
+
{
|
|
238
|
+
provide: DateTimeAdapter,
|
|
239
|
+
useClass: MomentDateTimeAdapter,
|
|
240
|
+
deps: [LOCALE_ID, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
provide: NXT_DATE_TIME_FORMATS,
|
|
244
|
+
useValue: NXT_MOMENT_DATE_TIME_FORMATS
|
|
245
|
+
}
|
|
246
|
+
];
|
|
247
|
+
}
|
|
235
248
|
class MomentDateTimeModule {
|
|
236
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
237
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
238
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
239
|
-
|
|
240
|
-
provide: DateTimeAdapter,
|
|
241
|
-
useClass: MomentDateTimeAdapter,
|
|
242
|
-
deps: [LOCALE_ID, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
provide: NXT_DATE_TIME_FORMATS,
|
|
246
|
-
useValue: NXT_MOMENT_DATE_TIME_FORMATS
|
|
247
|
-
}
|
|
249
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: MomentDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
250
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: MomentDateTimeModule }); }
|
|
251
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: MomentDateTimeModule, providers: [
|
|
252
|
+
provideMomentDateTimeAdapter()
|
|
248
253
|
] }); }
|
|
249
254
|
}
|
|
250
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: MomentDateTimeModule, decorators: [{
|
|
251
256
|
type: NgModule,
|
|
252
257
|
args: [{
|
|
253
258
|
providers: [
|
|
254
|
-
|
|
255
|
-
provide: DateTimeAdapter,
|
|
256
|
-
useClass: MomentDateTimeAdapter,
|
|
257
|
-
deps: [LOCALE_ID, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
provide: NXT_DATE_TIME_FORMATS,
|
|
261
|
-
useValue: NXT_MOMENT_DATE_TIME_FORMATS
|
|
262
|
-
}
|
|
259
|
+
provideMomentDateTimeAdapter()
|
|
263
260
|
]
|
|
264
261
|
}]
|
|
265
262
|
}] });
|
|
@@ -268,5 +265,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
268
265
|
* Generated bundle index. Do not edit.
|
|
269
266
|
*/
|
|
270
267
|
|
|
271
|
-
export { MomentDateTimeModule, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS };
|
|
268
|
+
export { MomentDateTimeModule, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS, provideMomentDateTimeAdapter };
|
|
272
269
|
//# sourceMappingURL=nxt-pick-datetime-moment-adapter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nxt-pick-datetime-moment-adapter.mjs","sources":["../../../packages/pick-datetime/moment-adapter/src/date-time-adapter.class.ts","../../../packages/pick-datetime/moment-adapter/src/date-time-format.class.ts","../../../packages/pick-datetime/moment-adapter/src/moment-adapter.module.ts","../../../packages/pick-datetime/moment-adapter/src/nxt-pick-datetime-moment-adapter.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, LOCALE_ID, Optional } from '@angular/core'\nimport moment, { Moment } from 'moment'\nimport { DateTimeAdapter } from 'nxt-pick-datetime'\n\n/** Configurable options for {@see MomentDateAdapter} */\nexport interface MomentDateTimeAdapterOptions {\n /**\n * Turns the use of utc dates on or off.\n * Changing this will change how the DateTimePicker output value.\n * {@default false}\n */\n useUtc: boolean\n}\n\n/** InjectionToken for moment date adapter to configure options */\nexport const NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS = new InjectionToken<MomentDateTimeAdapterOptions>(\n 'NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY\n})\n\n/** @internal */\nexport function NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY(): MomentDateTimeAdapterOptions {\n return {\n useUtc: false\n }\n}\n\n/**\n * Creates an array and fills it with values.\n *\n * @internal\n */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length)\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i)\n }\n return valuesArray\n}\n\n@Injectable()\nexport class MomentDateTimeAdapter extends DateTimeAdapter<Moment> {\n\n private _localeData: {\n longMonths: string[]\n shortMonths: string[]\n longDaysOfWeek: string[]\n shortDaysOfWeek: string[]\n narrowDaysOfWeek: string[]\n dates: string[]\n } = {} as any\n\n constructor(\n @Optional()\n @Inject(LOCALE_ID)\n dateTimeLocale?: string,\n @Optional()\n @Inject(NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS)\n private readonly options?: MomentDateTimeAdapterOptions\n ) {\n super()\n this.setLocale(dateTimeLocale || moment.locale())\n }\n\n override setLocale(locale: string) {\n super.setLocale(locale)\n\n const momentLocaleData = moment.localeData(locale)\n this._localeData = {\n longMonths: momentLocaleData.months(),\n shortMonths: momentLocaleData.monthsShort(),\n longDaysOfWeek: momentLocaleData.weekdays(),\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D'))\n }\n }\n\n getYear(date: Moment): number {\n return this.clone(date).year()\n }\n\n getMonth(date: Moment): number {\n return this.clone(date).month()\n }\n\n getDay(date: Moment): number {\n return this.clone(date).day()\n }\n\n getDate(date: Moment): number {\n return this.clone(date).date()\n }\n\n getHours(date: Moment): number {\n return this.clone(date).hours()\n }\n\n getMinutes(date: Moment): number {\n return this.clone(date).minutes()\n }\n\n getSeconds(date: Moment): number {\n return this.clone(date).seconds()\n }\n\n getTime(date: Moment): number {\n return this.clone(date).valueOf()\n }\n\n getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth()\n }\n\n differenceInCalendarDays(dateLeft: Moment, dateRight: Moment): number {\n return this.clone(dateLeft).diff(dateRight, 'days')\n }\n\n getYearName(date: Moment): string {\n return this.clone(date).format('YYYY')\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n return style === 'long' ? this._localeData.longMonths : this._localeData.shortMonths\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (style === 'long') {\n return this._localeData.longDaysOfWeek\n }\n if (style === 'short') {\n return this._localeData.shortDaysOfWeek\n }\n return this._localeData.narrowDaysOfWeek\n }\n\n getDateNames(): string[] {\n return this._localeData.dates\n }\n\n toIso8601(date: Moment): string {\n return this.clone(date).format()\n }\n\n isEqual(dateLeft: Moment, dateRight: Moment): boolean {\n\n if (dateLeft && dateRight) {\n return this.clone(dateLeft).isSame(this.clone(dateRight))\n }\n\n return dateLeft === dateRight\n }\n\n isSameDay(dateLeft: Moment, dateRight: Moment): boolean {\n\n if (dateLeft && dateRight) {\n return this.clone(dateLeft).isSame(this.clone(dateRight), 'day')\n }\n\n return dateLeft === dateRight\n }\n\n isValid(date: Moment): boolean {\n return this.clone(date).isValid()\n }\n\n invalid(): Moment {\n return moment.invalid()\n }\n\n isDateInstance(obj: any): boolean {\n return moment.isMoment(obj)\n }\n\n addCalendarYears(date: Moment, amount: number): Moment {\n return this.clone(date).add({ years: amount })\n }\n\n addCalendarMonths(date: Moment, amount: number): Moment {\n return this.clone(date).add({ months: amount })\n }\n\n addCalendarDays(date: Moment, amount: number): Moment {\n return this.clone(date).add({ days: amount })\n }\n\n setHours(date: Moment, amount: number): Moment {\n return this.clone(date).hours(amount)\n }\n\n setMinutes(date: Moment, amount: number): Moment {\n return this.clone(date).minutes(amount)\n }\n\n setSeconds(date: Moment, amount: number): Moment {\n return this.clone(date).seconds(amount)\n }\n\n createDate(year: number, month: number, date: number): Moment\n createDate(year: number, month: number, date: number, hours: number = 0, minutes: number = 0, seconds: number = 0): Moment {\n if (month < 0 || month > 11) {\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`)\n }\n\n if (date < 1) {\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`)\n }\n\n if (hours < 0 || hours > 23) {\n throw Error(`Invalid hours \"${hours}\". Hours has to be between 0 and 23.`)\n }\n\n if (minutes < 0 || minutes > 59) {\n throw Error(`Invalid minutes \"${minutes}\". Minutes has to between 0 and 59.`)\n }\n\n if (seconds < 0 || seconds > 59) {\n throw Error(`Invalid seconds \"${seconds}\". Seconds has to be between 0 and 59.`)\n }\n\n const result = this.createMoment({ year, month, date, hours, minutes, seconds }).locale(this.locale)\n\n // If the result isn't valid, the date must have been out of bounds for this month.\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`)\n }\n\n return result\n }\n\n clone(date: Moment): Moment {\n return this.createMoment(date).clone().locale(this.locale)\n }\n\n now(): Moment {\n return this.createMoment().locale(this.locale)\n }\n\n format(date: Moment, displayFormat: any): string {\n date = this.clone(date)\n if (!this.isValid(date)) {\n throw Error('MomentDateTimeAdapter: Cannot format invalid date.')\n }\n return date.format(displayFormat)\n }\n\n parse(value: any, parseFormat: any): Moment | undefined {\n if (value && typeof value === 'string') {\n return this.createMoment(value, parseFormat, this.locale)\n }\n return value ? this.createMoment(value).locale(this.locale) : undefined\n }\n\n /**\n * Returns the given value if given a valid Moment or undefined. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\n * string into undefined. Returns an invalid date for all other values.\n */\n override deserialize(value: any): Moment | undefined {\n let date\n if (value instanceof Date) {\n date = this.createMoment(value)\n }\n if (typeof value === 'string') {\n if (!value) {\n return undefined\n }\n date = this.createMoment(value, moment.ISO_8601).locale(this.locale)\n }\n if (date && this.isValid(date)) {\n return date\n }\n return super.deserialize(value)\n }\n\n /** Creates a Moment instance while respecting the current UTC settings */\n private createMoment(...args: any[]): Moment {\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args)\n }\n}\n","import { DateTimeFormats } from 'nxt-pick-datetime'\n\n/**\n * @internal\n */\nexport const NXT_MOMENT_DATE_TIME_FORMATS: DateTimeFormats = {\n parseInput: 'l LT',\n fullPickerInput: 'l LT',\n datePickerInput: 'l',\n timePickerInput: 'LT',\n monthYearLabel: 'MMM YYYY',\n dateA11yLabel: 'LL',\n monthYearA11yLabel: 'MMMM YYYY'\n}\n","import { LOCALE_ID, NgModule } from '@angular/core'\nimport { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime'\nimport { MomentDateTimeAdapter, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS } from './date-time-adapter.class'\nimport { NXT_MOMENT_DATE_TIME_FORMATS } from './date-time-format.class'\n\n@NgModule({\n providers: [\n {\n provide: DateTimeAdapter,\n useClass: MomentDateTimeAdapter,\n deps: [LOCALE_ID, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS]\n },\n {\n provide: NXT_DATE_TIME_FORMATS,\n useValue: NXT_MOMENT_DATE_TIME_FORMATS\n }\n ]\n})\nexport class MomentDateTimeModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAcA;MACa,oCAAoC,GAAG,IAAI,cAAc,CAClE,sCAAsC,EAAE;AACxC,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,4CAA4C;AACxD,CAAA,EAAC;AAEF;SACgB,4CAA4C,GAAA;IACxD,OAAO;AACH,QAAA,MAAM,EAAE,KAAK;KAChB,CAAA;AACL,CAAC;AAED;;;;AAIG;AACH,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAAA;AACjE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAA;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7B,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;AACpC,KAAA;AACD,IAAA,OAAO,WAAW,CAAA;AACtB,CAAC;AAGK,MAAO,qBAAsB,SAAQ,eAAuB,CAAA;IAW9D,WAGI,CAAA,cAAuB,EAGN,OAAsC,EAAA;AAEvD,QAAA,KAAK,EAAE,CAAA;QAFU,IA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gBAAA,QAAQ,EAAE,qBAAqB;AAC/B,gBAAA,IAAI,EAAE,CAAC,SAAS,EAAE,oCAAoC,CAAC;AAC1D,aAAA;AACD,YAAA;AACI,gBAAA,OAAO,EAAE,qBAAqB;AAC9B,gBAAA,QAAQ,EAAE,4BAA4B;AACzC,aAAA;AACJ,SAAA,EAAA,CAAA,CAAA,EAAA;;2FAEQ,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAbhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,SAAS,EAAE;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,eAAe;AACxB,4BAAA,QAAQ,EAAE,qBAAqB;AAC/B,4BAAA,IAAI,EAAE,CAAC,SAAS,EAAE,oCAAoC,CAAC;AAC1D,yBAAA;AACD,wBAAA;AACI,4BAAA,OAAO,EAAE,qBAAqB;AAC9B,4BAAA,QAAQ,EAAE,4BAA4B;AACzC,yBAAA;AACJ,qBAAA;AACJ,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"nxt-pick-datetime-moment-adapter.mjs","sources":["../../../packages/pick-datetime/moment-adapter/src/date-time-adapter.class.ts","../../../packages/pick-datetime/moment-adapter/src/date-time-format.class.ts","../../../packages/pick-datetime/moment-adapter/src/moment-adapter.module.ts","../../../packages/pick-datetime/moment-adapter/src/nxt-pick-datetime-moment-adapter.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, LOCALE_ID, Optional } from '@angular/core'\r\nimport moment, { Moment } from 'moment'\r\nimport { DateTimeAdapter } from 'nxt-pick-datetime'\r\n\r\n/** Configurable options for {@see MomentDateAdapter} */\r\nexport interface MomentDateTimeAdapterOptions {\r\n /**\r\n * Turns the use of utc dates on or off.\r\n * Changing this will change how the DateTimePicker output value.\r\n * {@default false}\r\n */\r\n useUtc: boolean\r\n}\r\n\r\n/** InjectionToken for moment date adapter to configure options */\r\nexport const NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS = new InjectionToken<MomentDateTimeAdapterOptions>(\r\n 'NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS', {\r\n providedIn: 'root',\r\n factory: NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY\r\n})\r\n\r\n/** @internal */\r\nexport function NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY(): MomentDateTimeAdapterOptions {\r\n return {\r\n useUtc: false\r\n }\r\n}\r\n\r\n/**\r\n * Creates an array and fills it with values.\r\n *\r\n * @internal\r\n */\r\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\r\n const valuesArray = Array(length)\r\n for (let i = 0; i < length; i++) {\r\n valuesArray[i] = valueFunction(i)\r\n }\r\n return valuesArray\r\n}\r\n\r\n@Injectable()\r\nexport class MomentDateTimeAdapter extends DateTimeAdapter<Moment> {\r\n\r\n private _localeData: {\r\n longMonths: string[]\r\n shortMonths: string[]\r\n longDaysOfWeek: string[]\r\n shortDaysOfWeek: string[]\r\n narrowDaysOfWeek: string[]\r\n dates: string[]\r\n } = {} as any\r\n\r\n constructor(\r\n @Optional()\r\n @Inject(LOCALE_ID)\r\n dateTimeLocale?: string,\r\n @Optional()\r\n @Inject(NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS)\r\n private readonly options?: MomentDateTimeAdapterOptions\r\n ) {\r\n super()\r\n this.setLocale(dateTimeLocale || moment.locale())\r\n }\r\n\r\n override setLocale(locale: string) {\r\n super.setLocale(locale)\r\n\r\n const momentLocaleData = moment.localeData(locale)\r\n this._localeData = {\r\n longMonths: momentLocaleData.months(),\r\n shortMonths: momentLocaleData.monthsShort(),\r\n longDaysOfWeek: momentLocaleData.weekdays(),\r\n shortDaysOfWeek: momentLocaleData.weekdaysShort(),\r\n narrowDaysOfWeek: momentLocaleData.weekdaysMin(),\r\n dates: range(31, (i) => this.createDate(2017, 0, i + 1).format('D'))\r\n }\r\n }\r\n\r\n getYear(date: Moment): number {\r\n return this.clone(date).year()\r\n }\r\n\r\n getMonth(date: Moment): number {\r\n return this.clone(date).month()\r\n }\r\n\r\n getDay(date: Moment): number {\r\n return this.clone(date).day()\r\n }\r\n\r\n getDate(date: Moment): number {\r\n return this.clone(date).date()\r\n }\r\n\r\n getHours(date: Moment): number {\r\n return this.clone(date).hours()\r\n }\r\n\r\n getMinutes(date: Moment): number {\r\n return this.clone(date).minutes()\r\n }\r\n\r\n getSeconds(date: Moment): number {\r\n return this.clone(date).seconds()\r\n }\r\n\r\n getTime(date: Moment): number {\r\n return this.clone(date).valueOf()\r\n }\r\n\r\n getNumDaysInMonth(date: Moment): number {\r\n return this.clone(date).daysInMonth()\r\n }\r\n\r\n differenceInCalendarDays(dateLeft: Moment, dateRight: Moment): number {\r\n return this.clone(dateLeft).diff(dateRight, 'days')\r\n }\r\n\r\n getYearName(date: Moment): string {\r\n return this.clone(date).format('YYYY')\r\n }\r\n\r\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\r\n return style === 'long' ? this._localeData.longMonths : this._localeData.shortMonths\r\n }\r\n\r\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\r\n if (style === 'long') {\r\n return this._localeData.longDaysOfWeek\r\n }\r\n if (style === 'short') {\r\n return this._localeData.shortDaysOfWeek\r\n }\r\n return this._localeData.narrowDaysOfWeek\r\n }\r\n\r\n getDateNames(): string[] {\r\n return this._localeData.dates\r\n }\r\n\r\n toIso8601(date: Moment): string {\r\n return this.clone(date).format()\r\n }\r\n\r\n isEqual(dateLeft: Moment, dateRight: Moment): boolean {\r\n\r\n if (dateLeft && dateRight) {\r\n return this.clone(dateLeft).isSame(this.clone(dateRight))\r\n }\r\n\r\n return dateLeft === dateRight\r\n }\r\n\r\n isSameDay(dateLeft: Moment, dateRight: Moment): boolean {\r\n\r\n if (dateLeft && dateRight) {\r\n return this.clone(dateLeft).isSame(this.clone(dateRight), 'day')\r\n }\r\n\r\n return dateLeft === dateRight\r\n }\r\n\r\n isValid(date: Moment): boolean {\r\n return this.clone(date).isValid()\r\n }\r\n\r\n invalid(): Moment {\r\n return moment.invalid()\r\n }\r\n\r\n isDateInstance(obj: any): boolean {\r\n return moment.isMoment(obj)\r\n }\r\n\r\n addCalendarYears(date: Moment, amount: number): Moment {\r\n return this.clone(date).add({ years: amount })\r\n }\r\n\r\n addCalendarMonths(date: Moment, amount: number): Moment {\r\n return this.clone(date).add({ months: amount })\r\n }\r\n\r\n addCalendarDays(date: Moment, amount: number): Moment {\r\n return this.clone(date).add({ days: amount })\r\n }\r\n\r\n setHours(date: Moment, amount: number): Moment {\r\n return this.clone(date).hours(amount)\r\n }\r\n\r\n setMinutes(date: Moment, amount: number): Moment {\r\n return this.clone(date).minutes(amount)\r\n }\r\n\r\n setSeconds(date: Moment, amount: number): Moment {\r\n return this.clone(date).seconds(amount)\r\n }\r\n\r\n createDate(year: number, month: number, date: number): Moment\r\n createDate(year: number, month: number, date: number, hours: number = 0, minutes: number = 0, seconds: number = 0): Moment {\r\n if (month < 0 || month > 11) {\r\n throw Error(`Invalid month index \"${month}\". Month index has to be between 0 and 11.`)\r\n }\r\n\r\n if (date < 1) {\r\n throw Error(`Invalid date \"${date}\". Date has to be greater than 0.`)\r\n }\r\n\r\n if (hours < 0 || hours > 23) {\r\n throw Error(`Invalid hours \"${hours}\". Hours has to be between 0 and 23.`)\r\n }\r\n\r\n if (minutes < 0 || minutes > 59) {\r\n throw Error(`Invalid minutes \"${minutes}\". Minutes has to between 0 and 59.`)\r\n }\r\n\r\n if (seconds < 0 || seconds > 59) {\r\n throw Error(`Invalid seconds \"${seconds}\". Seconds has to be between 0 and 59.`)\r\n }\r\n\r\n const result = this.createMoment({ year, month, date, hours, minutes, seconds }).locale(this.locale)\r\n\r\n // If the result isn't valid, the date must have been out of bounds for this month.\r\n if (!result.isValid()) {\r\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\".`)\r\n }\r\n\r\n return result\r\n }\r\n\r\n clone(date: Moment): Moment {\r\n return this.createMoment(date).clone().locale(this.locale)\r\n }\r\n\r\n now(): Moment {\r\n return this.createMoment().locale(this.locale)\r\n }\r\n\r\n format(date: Moment, displayFormat: any): string {\r\n date = this.clone(date)\r\n if (!this.isValid(date)) {\r\n throw Error('MomentDateTimeAdapter: Cannot format invalid date.')\r\n }\r\n return date.format(displayFormat)\r\n }\r\n\r\n parse(value: any, parseFormat: any): Moment | undefined {\r\n if (value && typeof value === 'string') {\r\n return this.createMoment(value, parseFormat, this.locale)\r\n }\r\n return value ? this.createMoment(value).locale(this.locale) : undefined\r\n }\r\n\r\n /**\r\n * Returns the given value if given a valid Moment or undefined. Deserializes valid ISO 8601 strings\r\n * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty\r\n * string into undefined. Returns an invalid date for all other values.\r\n */\r\n override deserialize(value: any): Moment | undefined {\r\n let date\r\n if (value instanceof Date) {\r\n date = this.createMoment(value)\r\n }\r\n if (typeof value === 'string') {\r\n if (!value) {\r\n return undefined\r\n }\r\n date = this.createMoment(value, moment.ISO_8601).locale(this.locale)\r\n }\r\n if (date && this.isValid(date)) {\r\n return date\r\n }\r\n return super.deserialize(value)\r\n }\r\n\r\n /** Creates a Moment instance while respecting the current UTC settings */\r\n private createMoment(...args: any[]): Moment {\r\n return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args)\r\n }\r\n}\r\n","import { DateTimeFormats } from 'nxt-pick-datetime'\r\n\r\n/**\r\n * @internal\r\n */\r\nexport const NXT_MOMENT_DATE_TIME_FORMATS: DateTimeFormats = {\r\n parseInput: 'l LT',\r\n fullPickerInput: 'l LT',\r\n datePickerInput: 'l',\r\n timePickerInput: 'LT',\r\n monthYearLabel: 'MMM YYYY',\r\n dateA11yLabel: 'LL',\r\n monthYearA11yLabel: 'MMMM YYYY'\r\n}\r\n","import { LOCALE_ID, NgModule, Provider } from '@angular/core'\r\nimport { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime'\r\nimport { MomentDateTimeAdapter, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS } from './date-time-adapter.class'\r\nimport { NXT_MOMENT_DATE_TIME_FORMATS } from './date-time-format.class'\r\n\r\nexport function provideMomentDateTimeAdapter(): Provider[] {\r\n return [\r\n {\r\n provide: DateTimeAdapter,\r\n useClass: MomentDateTimeAdapter,\r\n deps: [LOCALE_ID, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS]\r\n },\r\n {\r\n provide: NXT_DATE_TIME_FORMATS,\r\n useValue: NXT_MOMENT_DATE_TIME_FORMATS\r\n }\r\n ]\r\n}\r\n\r\n@NgModule({\r\n providers: [\r\n provideMomentDateTimeAdapter()\r\n ]\r\n})\r\nexport class MomentDateTimeModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAcA;MACa,oCAAoC,GAAG,IAAI,cAAc,CAClE,sCAAsC,EAAE;AACxC,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AAED;SACgB,4CAA4C,GAAA;IACxD,OAAO;AACH,QAAA,MAAM,EAAE;KACX;AACL;AAEA;;;;AAIG;AACH,SAAS,KAAK,CAAI,MAAc,EAAE,aAAmC,EAAA;AACjE,IAAA,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC;AACjC,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7B,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;;AAErC,IAAA,OAAO,WAAW;AACtB;AAGM,MAAO,qBAAsB,SAAQ,eAAuB,CAAA;IAW9D,WAGI,CAAA,cAAuB,EAGN,OAAsC,EAAA;AAEvD,QAAA,KAAK,EAAE;QAFU,IAAO,CAAA,OAAA,GAAP,OAAO;QAfpB,IAAW,CAAA,WAAA,GAOf,EAAS;QAWT,IAAI,CAAC,SAAS,CAAC,cAAc,IAAI,MAAM,CAAC,M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AAC1B,IAAA,aAAa,EAAE,IAAI;AACnB,IAAA,kBAAkB,EAAE;CACvB;;SCRe,4BAA4B,GAAA;IACxC,OAAO;AACH,QAAA;AACI,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,QAAQ,EAAE,qBAAqB;AAC/B,YAAA,IAAI,EAAE,CAAC,SAAS,EAAE,oCAAoC;AACzD,SAAA;AACD,QAAA;AACI,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;MAOa,oBAAoB,CAAA;8GAApB,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAApB,oBAAoB,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EAJlB,SAAA,EAAA;AACP,YAAA,4BAA4B;AAC/B,SAAA,EAAA,CAAA,CAAA;;2FAEQ,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,SAAS,EAAE;AACP,wBAAA,4BAA4B;AAC/B;AACJ,iBAAA;;;ACvBD;;AAEG;;;;"}
|
|
@@ -354,10 +354,10 @@ class NativeDateTimeAdapter extends DateTimeAdapter {
|
|
|
354
354
|
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
355
355
|
return dtf.format(d);
|
|
356
356
|
}
|
|
357
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
358
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
357
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NativeDateTimeAdapter, deps: [{ token: i1.Platform }, { token: LOCALE_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
358
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NativeDateTimeAdapter }); }
|
|
359
359
|
}
|
|
360
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
360
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NativeDateTimeAdapter, decorators: [{
|
|
361
361
|
type: Injectable
|
|
362
362
|
}], ctorParameters: () => [{ type: i1.Platform }, { type: undefined, decorators: [{
|
|
363
363
|
type: Optional
|
|
@@ -379,33 +379,31 @@ const NXT_NATIVE_DATE_TIME_FORMATS = {
|
|
|
379
379
|
monthYearA11yLabel: { year: 'numeric', month: 'long' }
|
|
380
380
|
};
|
|
381
381
|
|
|
382
|
+
function provideNativeDateTimeAdapter() {
|
|
383
|
+
return [
|
|
384
|
+
{
|
|
385
|
+
provide: DateTimeAdapter,
|
|
386
|
+
useClass: NativeDateTimeAdapter
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
provide: NXT_DATE_TIME_FORMATS,
|
|
390
|
+
useValue: NXT_NATIVE_DATE_TIME_FORMATS
|
|
391
|
+
}
|
|
392
|
+
];
|
|
393
|
+
}
|
|
382
394
|
class NativeDateTimeModule {
|
|
383
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
384
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
385
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
386
|
-
|
|
387
|
-
provide: DateTimeAdapter,
|
|
388
|
-
useClass: NativeDateTimeAdapter
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
provide: NXT_DATE_TIME_FORMATS,
|
|
392
|
-
useValue: NXT_NATIVE_DATE_TIME_FORMATS
|
|
393
|
-
}
|
|
395
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NativeDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
396
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: NativeDateTimeModule, imports: [PlatformModule] }); }
|
|
397
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NativeDateTimeModule, providers: [
|
|
398
|
+
provideNativeDateTimeAdapter()
|
|
394
399
|
], imports: [PlatformModule] }); }
|
|
395
400
|
}
|
|
396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: NativeDateTimeModule, decorators: [{
|
|
397
402
|
type: NgModule,
|
|
398
403
|
args: [{
|
|
399
404
|
imports: [PlatformModule],
|
|
400
405
|
providers: [
|
|
401
|
-
|
|
402
|
-
provide: DateTimeAdapter,
|
|
403
|
-
useClass: NativeDateTimeAdapter
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
provide: NXT_DATE_TIME_FORMATS,
|
|
407
|
-
useValue: NXT_NATIVE_DATE_TIME_FORMATS
|
|
408
|
-
}
|
|
406
|
+
provideNativeDateTimeAdapter()
|
|
409
407
|
]
|
|
410
408
|
}]
|
|
411
409
|
}] });
|
|
@@ -414,5 +412,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImpor
|
|
|
414
412
|
* Generated bundle index. Do not edit.
|
|
415
413
|
*/
|
|
416
414
|
|
|
417
|
-
export { NativeDateTimeModule };
|
|
415
|
+
export { NativeDateTimeModule, provideNativeDateTimeAdapter };
|
|
418
416
|
//# sourceMappingURL=nxt-pick-datetime-native-adapter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nxt-pick-datetime-native-adapter.mjs","sources":["../../../packages/pick-datetime/native-adapter/src/date-time-adapter.class.ts","../../../packages/pick-datetime/native-adapter/src/date-time-format.class.ts","../../../packages/pick-datetime/native-adapter/src/native-adapter.module.ts","../../../packages/pick-datetime/native-adapter/src/nxt-pick-datetime-native-adapter.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform'\nimport { Inject, Injectable, LOCALE_ID, Optional } from '@angular/core'\nimport { DateTimeAdapter } from 'nxt-pick-datetime'\n\n/**\n * The default month names to use if Intl API is not available.\n *\n * @internal\n */\nconst DEFAULT_MONTH_NAMES = {\n long: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ],\n short: [\n 'Jan',\n 'Feb',\n 'Mar',\n 'Apr',\n 'May',\n 'Jun',\n 'Jul',\n 'Aug',\n 'Sep',\n 'Oct',\n 'Nov',\n 'Dec'\n ],\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D']\n}\n\n/**\n * The default day of the week names to use if Intl API is not available.\n *\n * @internal\n */\nconst DEFAULT_DAY_OF_WEEK_NAMES = {\n long: [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday'\n ],\n short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S']\n}\n\n/**\n * The default date names to use if Intl API is not available.\n *\n * @internal\n */\nconst DEFAULT_DATE_NAMES = range(31, i => String(i + 1))\n\n/**\n * Whether the browser supports the Intl API.\n *\n * @internal\n */\nconst SUPPORTS_INTL_API = typeof Intl !== 'undefined'\n\n/**\n * Matches strings that have the form of a valid RFC 3339 string\n * (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date\n * because the regex will match strings an with out of bounds month, date, etc.\n *\n * @internal\n */\nconst ISO_8601_REGEX = /^\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|(?:(?:\\+|-)\\d{2}:\\d{2}))?)?$/\n\n/**\n * Creates an array and fills it with values.\n *\n * @internal\n */\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\n const valuesArray = Array(length)\n for (let i = 0; i < length; i++) {\n valuesArray[i] = valueFunction(i)\n }\n return valuesArray\n}\n\n@Injectable()\nexport class NativeDateTimeAdapter extends DateTimeAdapter<Date> {\n /** Whether to clamp the date between 1 and 9999 to avoid IE and Edge errors */\n private readonly _clampDate: boolean\n\n /**\n * Whether to use `timeZone: 'utc'` with `Intl.DateTimeFormat` when formatting dates.\n * Without this `Intl.DateTimeFormat` sometimes chooses the wrong timeZone, which can throw off\n * the result. (e.g. in the en-US locale `new Date(1800, 7, 14).toLocaleDateString()`\n * will produce `'8/13/1800'`.\n */\n useUtcForDisplay: boolean\n\n constructor(\n platform: Platform,\n @Optional()\n @Inject(LOCALE_ID)\n dateTimeLocale?: string\n ) {\n super()\n super.setLocale(dateTimeLocale)\n\n // IE does its own time zone correction, so we disable this on IE.\n this.useUtcForDisplay = !platform.TRIDENT\n this._clampDate = platform.TRIDENT || platform.EDGE\n }\n\n getYear(date: Date): number {\n return date.getFullYear()\n }\n\n getMonth(date: Date): number {\n return date.getMonth()\n }\n\n getDay(date: Date): number {\n return date.getDay()\n }\n\n getDate(date: Date): number {\n return date.getDate()\n }\n\n getHours(date: Date): number {\n return date.getHours()\n }\n\n getMinutes(date: Date): number {\n return date.getMinutes()\n }\n\n getSeconds(date: Date): number {\n return date.getSeconds()\n }\n\n getTime(date: Date): number {\n return date.getTime()\n }\n\n getNumDaysInMonth(date: Date): number {\n const lastDateOfMonth = this.createDateWithOverflow(\n this.getYear(date),\n this.getMonth(date) + 1,\n 0\n )\n\n return this.getDate(lastDateOfMonth)\n }\n\n differenceInCalendarDays(dateLeft: Date, dateRight: Date): number | undefined {\n if (this.isValid(dateLeft) && this.isValid(dateRight)) {\n const dateLeftStartOfDay = this.createDate(\n this.getYear(dateLeft),\n this.getMonth(dateLeft),\n this.getDate(dateLeft)\n )\n const dateRightStartOfDay = this.createDate(\n this.getYear(dateRight),\n this.getMonth(dateRight),\n this.getDate(dateRight)\n )\n\n const timeStampLeft =\n this.getTime(dateLeftStartOfDay) -\n dateLeftStartOfDay.getTimezoneOffset() *\n this.milliseondsInMinute\n const timeStampRight =\n this.getTime(dateRightStartOfDay) -\n dateRightStartOfDay.getTimezoneOffset() *\n this.milliseondsInMinute\n return Math.round(\n (timeStampLeft - timeStampRight) / this.millisecondsInDay\n )\n } else {\n return undefined\n }\n }\n\n getYearName(date: Date): string {\n if (SUPPORTS_INTL_API) {\n const dtf = new Intl.DateTimeFormat(this.locale, {\n year: 'numeric',\n timeZone: 'utc'\n })\n return this.stripDirectionalityCharacters(this._format(dtf, date))\n }\n return String(this.getYear(date))\n }\n\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (SUPPORTS_INTL_API) {\n const dtf = new Intl.DateTimeFormat(this.locale, {\n month: style,\n timeZone: 'utc'\n })\n return range(12, i =>\n this.stripDirectionalityCharacters(\n this._format(dtf, new Date(2017, i, 1))\n )\n )\n }\n return DEFAULT_MONTH_NAMES[style]\n }\n\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n if (SUPPORTS_INTL_API) {\n const dtf = new Intl.DateTimeFormat(this.locale, {\n weekday: style,\n timeZone: 'utc'\n })\n return range(7, i =>\n this.stripDirectionalityCharacters(\n this._format(dtf, new Date(2017, 0, i + 1))\n )\n )\n }\n\n return DEFAULT_DAY_OF_WEEK_NAMES[style]\n }\n\n getDateNames(): string[] {\n if (SUPPORTS_INTL_API) {\n const dtf = new Intl.DateTimeFormat(this.locale, {\n day: 'numeric',\n timeZone: 'utc'\n })\n return range(31, i =>\n this.stripDirectionalityCharacters(\n this._format(dtf, new Date(2017, 0, i + 1))\n )\n )\n }\n return DEFAULT_DATE_NAMES\n }\n\n toIso8601(date: Date): string {\n return date.toISOString()\n }\n\n isEqual(dateLeft: Date, dateRight: Date): boolean {\n if (this.isValid(dateLeft) && this.isValid(dateRight)) {\n return dateLeft.getTime() === dateRight.getTime()\n } else {\n return false\n }\n }\n\n isSameDay(dateLeft: Date, dateRight: Date): boolean {\n if (this.isValid(dateLeft) && this.isValid(dateRight)) {\n const dateLeftStartOfDay = this.clone(dateLeft)\n const dateRightStartOfDay = this.clone(dateRight)\n dateLeftStartOfDay.setHours(0, 0, 0, 0)\n dateRightStartOfDay.setHours(0, 0, 0, 0)\n return (\n dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime()\n )\n } else {\n return false\n }\n }\n\n isValid(date: Date): boolean {\n return date && !isNaN(date.getTime())\n }\n\n invalid(): Date {\n return new Date(NaN)\n }\n\n isDateInstance(obj: any): boolean {\n return obj instanceof Date\n }\n\n addCalendarYears(date: Date, amount: number): Date {\n return this.addCalendarMonths(date, amount * 12)\n }\n\n addCalendarMonths(date: Date, amount: number): Date {\n const result = this.clone(date)\n amount = Number(amount)\n\n const desiredMonth = result.getMonth() + amount\n const dateWithDesiredMonth = new Date(0)\n dateWithDesiredMonth.setFullYear(result.getFullYear(), desiredMonth, 1)\n dateWithDesiredMonth.setHours(0, 0, 0, 0)\n\n const daysInMonth = this.getNumDaysInMonth(dateWithDesiredMonth)\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n result.setMonth(desiredMonth, Math.min(daysInMonth, result.getDate()))\n return result\n }\n\n addCalendarDays(date: Date, amount: number): Date {\n const result = this.clone(date)\n amount = Number(amount)\n result.setDate(result.getDate() + amount)\n return result\n }\n\n setHours(date: Date, amount: number): Date {\n const result = this.clone(date)\n result.setHours(amount)\n return result\n }\n\n setMinutes(date: Date, amount: number): Date {\n const result = this.clone(date)\n result.setMinutes(amount)\n return result\n }\n\n setSeconds(date: Date, amount: number): Date {\n const result = this.clone(date)\n result.setSeconds(amount)\n return result\n }\n\n createDate(\n year: number,\n month: number,\n date: number,\n hours: number = 0,\n minutes: number = 0,\n seconds: number = 0\n ): Date {\n if (month < 0 || month > 11) {\n throw Error(\n `Invalid month index \"${month}\". Month index has to be between 0 and 11.`\n )\n }\n\n if (date < 1) {\n throw Error(\n `Invalid date \"${date}\". Date has to be greater than 0.`\n )\n }\n\n if (hours < 0 || hours > 23) {\n throw Error(\n `Invalid hours \"${hours}\". Hours has to be between 0 and 23.`\n )\n }\n\n if (minutes < 0 || minutes > 59) {\n throw Error(\n `Invalid minutes \"${minutes}\". Minutes has to between 0 and 59.`\n )\n }\n\n if (seconds < 0 || seconds > 59) {\n throw Error(\n `Invalid seconds \"${seconds}\". Seconds has to be between 0 and 59.`\n )\n }\n\n const result = this.createDateWithOverflow(\n year,\n month,\n date,\n hours,\n minutes,\n seconds\n )\n\n // Check that the date wasn't above the upper bound for the month, causing the month to overflow\n // For example, createDate(2017, 1, 31) would try to create a date 2017/02/31 which is invalid\n if (result.getMonth() !== month) {\n throw Error(\n `Invalid date \"${date}\" for month with index \"${month}\".`\n )\n }\n\n return result\n }\n\n clone(date: Date): Date {\n return this.createDate(\n this.getYear(date),\n this.getMonth(date),\n this.getDate(date),\n this.getHours(date),\n this.getMinutes(date),\n this.getSeconds(date)\n )\n }\n\n now(): Date {\n return new Date()\n }\n\n format(date: Date, displayFormat: any): string {\n if (!this.isValid(date)) {\n throw Error('JSNativeDate: Cannot format invalid date.')\n }\n\n if (SUPPORTS_INTL_API) {\n if (\n this._clampDate &&\n (date.getFullYear() < 1 || date.getFullYear() > 9999)\n ) {\n date = this.clone(date)\n date.setFullYear(\n Math.max(1, Math.min(9999, date.getFullYear()))\n )\n }\n\n displayFormat = { ...displayFormat, timeZone: 'utc' }\n const dtf = new Intl.DateTimeFormat(this.locale, displayFormat)\n return this.stripDirectionalityCharacters(this._format(dtf, date))\n }\n\n return this.stripDirectionalityCharacters(date.toDateString())\n }\n\n parse(value: any, _parseFormat: any): Date | undefined {\n // There is no way using the native JS Date to set the parse format or locale\n if (typeof value === 'number') {\n return new Date(value)\n }\n return value ? new Date(Date.parse(value)) : undefined\n }\n\n /**\n * Returns the given value if given a valid Date or undefined. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into undefined. Returns an\n * invalid date for all other values.\n */\n override deserialize(value: any): Date | undefined {\n if (typeof value === 'string') {\n if (!value) {\n return undefined\n }\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\n // string is the right format first.\n if (ISO_8601_REGEX.test(value)) {\n const date = new Date(value)\n if (this.isValid(date)) {\n return date\n }\n }\n }\n return super.deserialize(value)\n }\n\n /**\n * Creates a date but allows the month and date to overflow.\n */\n private createDateWithOverflow(\n year: number,\n month: number,\n date: number,\n hours: number = 0,\n minutes: number = 0,\n seconds: number = 0\n ): Date {\n const result = new Date(year, month, date, hours, minutes, seconds)\n\n if (year >= 0 && year < 100) {\n result.setFullYear(this.getYear(result) - 1900)\n }\n return result\n }\n\n /**\n * Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while\n * other browsers do not. We remove them to make output consistent and because they interfere with\n * date parsing.\n */\n private stripDirectionalityCharacters(str: string) {\n return str.replace(/[\\u200e\\u200f]/g, '')\n }\n\n /**\n * When converting Date object to string, javascript built-in functions may return wrong\n * results because it applies its internal DST rules. The DST rules around the world change\n * very frequently, and the current valid rule is not always valid in previous years though.\n * We work around this problem building a new Date object which has its internal UTC\n * representation with the local date and time.\n */\n private _format(dtf: Intl.DateTimeFormat, date: Date) {\n const d = new Date(\n Date.UTC(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n )\n )\n return dtf.format(d)\n }\n}\n","import { DateTimeFormats } from 'nxt-pick-datetime'\n\n/**\n * @internal\n */\nexport const NXT_NATIVE_DATE_TIME_FORMATS: DateTimeFormats = {\n parseInput: null,\n fullPickerInput: { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' },\n datePickerInput: { year: 'numeric', month: 'numeric', day: 'numeric' },\n timePickerInput: { hour: 'numeric', minute: 'numeric' },\n monthYearLabel: { year: 'numeric', month: 'short' },\n dateA11yLabel: { year: 'numeric', month: 'long', day: 'numeric' },\n monthYearA11yLabel: { year: 'numeric', month: 'long' }\n}\n","import { PlatformModule } from '@angular/cdk/platform'\nimport { NgModule } from '@angular/core'\nimport { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime'\nimport { NativeDateTimeAdapter } from './date-time-adapter.class'\nimport { NXT_NATIVE_DATE_TIME_FORMATS } from './date-time-format.class'\n\n@NgModule({\n imports: [PlatformModule],\n providers: [\n {\n provide: DateTimeAdapter,\n useClass: NativeDateTimeAdapter\n },\n {\n provide: NXT_DATE_TIME_FORMATS,\n useValue: NXT_NATIVE_DATE_TIME_FORMATS\n }\n ]\n})\nexport class NativeDateTimeModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAIA;;;;AAIG;AACH,MAAM,mBAAmB,GAAG;AACxB,IAAA,IAAI,EAAE;QACF,SAAS;QACT,UAAU;QACV,OAAO;QACP,OAAO;QACP,KAAK;QACL,MAAM;QACN,MAAM;QACN,QAAQ;QACR,WAAW;QACX,SAAS;QACT,UAAU;QACV,UAAU;AACb,KAAA;AACD,IAAA,KAAK,EAAE;QACH,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;AACR,KAAA;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,G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AA;AACD,wBAAA;AACI,4BAAA,OAAO,EAAE,qBAAqB;AAC9B,4BAAA,QAAQ,EAAE,4BAA4B;AACzC,yBAAA;AACJ,qBAAA;AACJ,iBAAA,CAAA;;;AClBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"nxt-pick-datetime-native-adapter.mjs","sources":["../../../packages/pick-datetime/native-adapter/src/date-time-adapter.class.ts","../../../packages/pick-datetime/native-adapter/src/date-time-format.class.ts","../../../packages/pick-datetime/native-adapter/src/native-adapter.module.ts","../../../packages/pick-datetime/native-adapter/src/nxt-pick-datetime-native-adapter.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform'\r\nimport { Inject, Injectable, LOCALE_ID, Optional } from '@angular/core'\r\nimport { DateTimeAdapter } from 'nxt-pick-datetime'\r\n\r\n/**\r\n * The default month names to use if Intl API is not available.\r\n *\r\n * @internal\r\n */\r\nconst DEFAULT_MONTH_NAMES = {\r\n long: [\r\n 'January',\r\n 'February',\r\n 'March',\r\n 'April',\r\n 'May',\r\n 'June',\r\n 'July',\r\n 'August',\r\n 'September',\r\n 'October',\r\n 'November',\r\n 'December'\r\n ],\r\n short: [\r\n 'Jan',\r\n 'Feb',\r\n 'Mar',\r\n 'Apr',\r\n 'May',\r\n 'Jun',\r\n 'Jul',\r\n 'Aug',\r\n 'Sep',\r\n 'Oct',\r\n 'Nov',\r\n 'Dec'\r\n ],\r\n narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D']\r\n}\r\n\r\n/**\r\n * The default day of the week names to use if Intl API is not available.\r\n *\r\n * @internal\r\n */\r\nconst DEFAULT_DAY_OF_WEEK_NAMES = {\r\n long: [\r\n 'Sunday',\r\n 'Monday',\r\n 'Tuesday',\r\n 'Wednesday',\r\n 'Thursday',\r\n 'Friday',\r\n 'Saturday'\r\n ],\r\n short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\r\n narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S']\r\n}\r\n\r\n/**\r\n * The default date names to use if Intl API is not available.\r\n *\r\n * @internal\r\n */\r\nconst DEFAULT_DATE_NAMES = range(31, i => String(i + 1))\r\n\r\n/**\r\n * Whether the browser supports the Intl API.\r\n *\r\n * @internal\r\n */\r\nconst SUPPORTS_INTL_API = typeof Intl !== 'undefined'\r\n\r\n/**\r\n * Matches strings that have the form of a valid RFC 3339 string\r\n * (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date\r\n * because the regex will match strings an with out of bounds month, date, etc.\r\n *\r\n * @internal\r\n */\r\nconst ISO_8601_REGEX = /^\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|(?:(?:\\+|-)\\d{2}:\\d{2}))?)?$/\r\n\r\n/**\r\n * Creates an array and fills it with values.\r\n *\r\n * @internal\r\n */\r\nfunction range<T>(length: number, valueFunction: (index: number) => T): T[] {\r\n const valuesArray = Array(length)\r\n for (let i = 0; i < length; i++) {\r\n valuesArray[i] = valueFunction(i)\r\n }\r\n return valuesArray\r\n}\r\n\r\n@Injectable()\r\nexport class NativeDateTimeAdapter extends DateTimeAdapter<Date> {\r\n /** Whether to clamp the date between 1 and 9999 to avoid IE and Edge errors */\r\n private readonly _clampDate: boolean\r\n\r\n /**\r\n * Whether to use `timeZone: 'utc'` with `Intl.DateTimeFormat` when formatting dates.\r\n * Without this `Intl.DateTimeFormat` sometimes chooses the wrong timeZone, which can throw off\r\n * the result. (e.g. in the en-US locale `new Date(1800, 7, 14).toLocaleDateString()`\r\n * will produce `'8/13/1800'`.\r\n */\r\n useUtcForDisplay: boolean\r\n\r\n constructor(\r\n platform: Platform,\r\n @Optional()\r\n @Inject(LOCALE_ID)\r\n dateTimeLocale?: string\r\n ) {\r\n super()\r\n super.setLocale(dateTimeLocale)\r\n\r\n // IE does its own time zone correction, so we disable this on IE.\r\n this.useUtcForDisplay = !platform.TRIDENT\r\n this._clampDate = platform.TRIDENT || platform.EDGE\r\n }\r\n\r\n getYear(date: Date): number {\r\n return date.getFullYear()\r\n }\r\n\r\n getMonth(date: Date): number {\r\n return date.getMonth()\r\n }\r\n\r\n getDay(date: Date): number {\r\n return date.getDay()\r\n }\r\n\r\n getDate(date: Date): number {\r\n return date.getDate()\r\n }\r\n\r\n getHours(date: Date): number {\r\n return date.getHours()\r\n }\r\n\r\n getMinutes(date: Date): number {\r\n return date.getMinutes()\r\n }\r\n\r\n getSeconds(date: Date): number {\r\n return date.getSeconds()\r\n }\r\n\r\n getTime(date: Date): number {\r\n return date.getTime()\r\n }\r\n\r\n getNumDaysInMonth(date: Date): number {\r\n const lastDateOfMonth = this.createDateWithOverflow(\r\n this.getYear(date),\r\n this.getMonth(date) + 1,\r\n 0\r\n )\r\n\r\n return this.getDate(lastDateOfMonth)\r\n }\r\n\r\n differenceInCalendarDays(dateLeft: Date, dateRight: Date): number | undefined {\r\n if (this.isValid(dateLeft) && this.isValid(dateRight)) {\r\n const dateLeftStartOfDay = this.createDate(\r\n this.getYear(dateLeft),\r\n this.getMonth(dateLeft),\r\n this.getDate(dateLeft)\r\n )\r\n const dateRightStartOfDay = this.createDate(\r\n this.getYear(dateRight),\r\n this.getMonth(dateRight),\r\n this.getDate(dateRight)\r\n )\r\n\r\n const timeStampLeft =\r\n this.getTime(dateLeftStartOfDay) -\r\n dateLeftStartOfDay.getTimezoneOffset() *\r\n this.milliseondsInMinute\r\n const timeStampRight =\r\n this.getTime(dateRightStartOfDay) -\r\n dateRightStartOfDay.getTimezoneOffset() *\r\n this.milliseondsInMinute\r\n return Math.round(\r\n (timeStampLeft - timeStampRight) / this.millisecondsInDay\r\n )\r\n } else {\r\n return undefined\r\n }\r\n }\r\n\r\n getYearName(date: Date): string {\r\n if (SUPPORTS_INTL_API) {\r\n const dtf = new Intl.DateTimeFormat(this.locale, {\r\n year: 'numeric',\r\n timeZone: 'utc'\r\n })\r\n return this.stripDirectionalityCharacters(this._format(dtf, date))\r\n }\r\n return String(this.getYear(date))\r\n }\r\n\r\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\r\n if (SUPPORTS_INTL_API) {\r\n const dtf = new Intl.DateTimeFormat(this.locale, {\r\n month: style,\r\n timeZone: 'utc'\r\n })\r\n return range(12, i =>\r\n this.stripDirectionalityCharacters(\r\n this._format(dtf, new Date(2017, i, 1))\r\n )\r\n )\r\n }\r\n return DEFAULT_MONTH_NAMES[style]\r\n }\r\n\r\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\r\n if (SUPPORTS_INTL_API) {\r\n const dtf = new Intl.DateTimeFormat(this.locale, {\r\n weekday: style,\r\n timeZone: 'utc'\r\n })\r\n return range(7, i =>\r\n this.stripDirectionalityCharacters(\r\n this._format(dtf, new Date(2017, 0, i + 1))\r\n )\r\n )\r\n }\r\n\r\n return DEFAULT_DAY_OF_WEEK_NAMES[style]\r\n }\r\n\r\n getDateNames(): string[] {\r\n if (SUPPORTS_INTL_API) {\r\n const dtf = new Intl.DateTimeFormat(this.locale, {\r\n day: 'numeric',\r\n timeZone: 'utc'\r\n })\r\n return range(31, i =>\r\n this.stripDirectionalityCharacters(\r\n this._format(dtf, new Date(2017, 0, i + 1))\r\n )\r\n )\r\n }\r\n return DEFAULT_DATE_NAMES\r\n }\r\n\r\n toIso8601(date: Date): string {\r\n return date.toISOString()\r\n }\r\n\r\n isEqual(dateLeft: Date, dateRight: Date): boolean {\r\n if (this.isValid(dateLeft) && this.isValid(dateRight)) {\r\n return dateLeft.getTime() === dateRight.getTime()\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n isSameDay(dateLeft: Date, dateRight: Date): boolean {\r\n if (this.isValid(dateLeft) && this.isValid(dateRight)) {\r\n const dateLeftStartOfDay = this.clone(dateLeft)\r\n const dateRightStartOfDay = this.clone(dateRight)\r\n dateLeftStartOfDay.setHours(0, 0, 0, 0)\r\n dateRightStartOfDay.setHours(0, 0, 0, 0)\r\n return (\r\n dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime()\r\n )\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n isValid(date: Date): boolean {\r\n return date && !isNaN(date.getTime())\r\n }\r\n\r\n invalid(): Date {\r\n return new Date(NaN)\r\n }\r\n\r\n isDateInstance(obj: any): boolean {\r\n return obj instanceof Date\r\n }\r\n\r\n addCalendarYears(date: Date, amount: number): Date {\r\n return this.addCalendarMonths(date, amount * 12)\r\n }\r\n\r\n addCalendarMonths(date: Date, amount: number): Date {\r\n const result = this.clone(date)\r\n amount = Number(amount)\r\n\r\n const desiredMonth = result.getMonth() + amount\r\n const dateWithDesiredMonth = new Date(0)\r\n dateWithDesiredMonth.setFullYear(result.getFullYear(), desiredMonth, 1)\r\n dateWithDesiredMonth.setHours(0, 0, 0, 0)\r\n\r\n const daysInMonth = this.getNumDaysInMonth(dateWithDesiredMonth)\r\n // Set the last day of the new month\r\n // if the original date was the last day of the longer month\r\n result.setMonth(desiredMonth, Math.min(daysInMonth, result.getDate()))\r\n return result\r\n }\r\n\r\n addCalendarDays(date: Date, amount: number): Date {\r\n const result = this.clone(date)\r\n amount = Number(amount)\r\n result.setDate(result.getDate() + amount)\r\n return result\r\n }\r\n\r\n setHours(date: Date, amount: number): Date {\r\n const result = this.clone(date)\r\n result.setHours(amount)\r\n return result\r\n }\r\n\r\n setMinutes(date: Date, amount: number): Date {\r\n const result = this.clone(date)\r\n result.setMinutes(amount)\r\n return result\r\n }\r\n\r\n setSeconds(date: Date, amount: number): Date {\r\n const result = this.clone(date)\r\n result.setSeconds(amount)\r\n return result\r\n }\r\n\r\n createDate(\r\n year: number,\r\n month: number,\r\n date: number,\r\n hours: number = 0,\r\n minutes: number = 0,\r\n seconds: number = 0\r\n ): Date {\r\n if (month < 0 || month > 11) {\r\n throw Error(\r\n `Invalid month index \"${month}\". Month index has to be between 0 and 11.`\r\n )\r\n }\r\n\r\n if (date < 1) {\r\n throw Error(\r\n `Invalid date \"${date}\". Date has to be greater than 0.`\r\n )\r\n }\r\n\r\n if (hours < 0 || hours > 23) {\r\n throw Error(\r\n `Invalid hours \"${hours}\". Hours has to be between 0 and 23.`\r\n )\r\n }\r\n\r\n if (minutes < 0 || minutes > 59) {\r\n throw Error(\r\n `Invalid minutes \"${minutes}\". Minutes has to between 0 and 59.`\r\n )\r\n }\r\n\r\n if (seconds < 0 || seconds > 59) {\r\n throw Error(\r\n `Invalid seconds \"${seconds}\". Seconds has to be between 0 and 59.`\r\n )\r\n }\r\n\r\n const result = this.createDateWithOverflow(\r\n year,\r\n month,\r\n date,\r\n hours,\r\n minutes,\r\n seconds\r\n )\r\n\r\n // Check that the date wasn't above the upper bound for the month, causing the month to overflow\r\n // For example, createDate(2017, 1, 31) would try to create a date 2017/02/31 which is invalid\r\n if (result.getMonth() !== month) {\r\n throw Error(\r\n `Invalid date \"${date}\" for month with index \"${month}\".`\r\n )\r\n }\r\n\r\n return result\r\n }\r\n\r\n clone(date: Date): Date {\r\n return this.createDate(\r\n this.getYear(date),\r\n this.getMonth(date),\r\n this.getDate(date),\r\n this.getHours(date),\r\n this.getMinutes(date),\r\n this.getSeconds(date)\r\n )\r\n }\r\n\r\n now(): Date {\r\n return new Date()\r\n }\r\n\r\n format(date: Date, displayFormat: any): string {\r\n if (!this.isValid(date)) {\r\n throw Error('JSNativeDate: Cannot format invalid date.')\r\n }\r\n\r\n if (SUPPORTS_INTL_API) {\r\n if (\r\n this._clampDate &&\r\n (date.getFullYear() < 1 || date.getFullYear() > 9999)\r\n ) {\r\n date = this.clone(date)\r\n date.setFullYear(\r\n Math.max(1, Math.min(9999, date.getFullYear()))\r\n )\r\n }\r\n\r\n displayFormat = { ...displayFormat, timeZone: 'utc' }\r\n const dtf = new Intl.DateTimeFormat(this.locale, displayFormat)\r\n return this.stripDirectionalityCharacters(this._format(dtf, date))\r\n }\r\n\r\n return this.stripDirectionalityCharacters(date.toDateString())\r\n }\r\n\r\n parse(value: any, _parseFormat: any): Date | undefined {\r\n // There is no way using the native JS Date to set the parse format or locale\r\n if (typeof value === 'number') {\r\n return new Date(value)\r\n }\r\n return value ? new Date(Date.parse(value)) : undefined\r\n }\r\n\r\n /**\r\n * Returns the given value if given a valid Date or undefined. Deserializes valid ISO 8601 strings\r\n * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into undefined. Returns an\r\n * invalid date for all other values.\r\n */\r\n override deserialize(value: any): Date | undefined {\r\n if (typeof value === 'string') {\r\n if (!value) {\r\n return undefined\r\n }\r\n // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the\r\n // string is the right format first.\r\n if (ISO_8601_REGEX.test(value)) {\r\n const date = new Date(value)\r\n if (this.isValid(date)) {\r\n return date\r\n }\r\n }\r\n }\r\n return super.deserialize(value)\r\n }\r\n\r\n /**\r\n * Creates a date but allows the month and date to overflow.\r\n */\r\n private createDateWithOverflow(\r\n year: number,\r\n month: number,\r\n date: number,\r\n hours: number = 0,\r\n minutes: number = 0,\r\n seconds: number = 0\r\n ): Date {\r\n const result = new Date(year, month, date, hours, minutes, seconds)\r\n\r\n if (year >= 0 && year < 100) {\r\n result.setFullYear(this.getYear(result) - 1900)\r\n }\r\n return result\r\n }\r\n\r\n /**\r\n * Strip out unicode LTR and RTL characters. Edge and IE insert these into formatted dates while\r\n * other browsers do not. We remove them to make output consistent and because they interfere with\r\n * date parsing.\r\n */\r\n private stripDirectionalityCharacters(str: string) {\r\n return str.replace(/[\\u200e\\u200f]/g, '')\r\n }\r\n\r\n /**\r\n * When converting Date object to string, javascript built-in functions may return wrong\r\n * results because it applies its internal DST rules. The DST rules around the world change\r\n * very frequently, and the current valid rule is not always valid in previous years though.\r\n * We work around this problem building a new Date object which has its internal UTC\r\n * representation with the local date and time.\r\n */\r\n private _format(dtf: Intl.DateTimeFormat, date: Date) {\r\n const d = new Date(\r\n Date.UTC(\r\n date.getFullYear(),\r\n date.getMonth(),\r\n date.getDate(),\r\n date.getHours(),\r\n date.getMinutes(),\r\n date.getSeconds(),\r\n date.getMilliseconds()\r\n )\r\n )\r\n return dtf.format(d)\r\n }\r\n}\r\n","import { DateTimeFormats } from 'nxt-pick-datetime'\r\n\r\n/**\r\n * @internal\r\n */\r\nexport const NXT_NATIVE_DATE_TIME_FORMATS: DateTimeFormats = {\r\n parseInput: null,\r\n fullPickerInput: { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' },\r\n datePickerInput: { year: 'numeric', month: 'numeric', day: 'numeric' },\r\n timePickerInput: { hour: 'numeric', minute: 'numeric' },\r\n monthYearLabel: { year: 'numeric', month: 'short' },\r\n dateA11yLabel: { year: 'numeric', month: 'long', day: 'numeric' },\r\n monthYearA11yLabel: { year: 'numeric', month: 'long' }\r\n}\r\n","import { PlatformModule } from '@angular/cdk/platform'\r\nimport { NgModule, Provider } from '@angular/core'\r\nimport { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime'\r\nimport { NativeDateTimeAdapter } from './date-time-adapter.class'\r\nimport { NXT_NATIVE_DATE_TIME_FORMATS } from './date-time-format.class'\r\n\r\nexport function provideNativeDateTimeAdapter(): Provider[] {\r\n return [\r\n {\r\n provide: DateTimeAdapter,\r\n useClass: NativeDateTimeAdapter\r\n },\r\n {\r\n provide: NXT_DATE_TIME_FORMATS,\r\n useValue: NXT_NATIVE_DATE_TIME_FORMATS\r\n }\r\n ]\r\n}\r\n\r\n@NgModule({\r\n imports: [PlatformModule],\r\n providers: [\r\n provideNativeDateTimeAdapter()\r\n ]\r\n})\r\nexport class NativeDateTimeModule { }\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAIA;;;;AAIG;AACH,MAAM,mBAAmB,GAAG;AACxB,IAAA,IAAI,EAAE;QACF,SAAS;QACT,UAAU;QACV,OAAO;QACP,OAAO;QACP,KAAK;QACL,MAAM;QACN,MAAM;QACN,QAAQ;QACR,WAAW;QACX,SAAS;QACT,UAAU;QACV;AACH,KAAA;AACD,IAAA,KAAK,EAAE;QACH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