nxt-pick-datetime 21.0.0-alpha.0 → 22.0.0-alpha.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/assets/picker.scss +13 -11
- package/fesm2022/nxt-pick-datetime-moment-adapter.mjs +5 -21
- package/fesm2022/nxt-pick-datetime-moment-adapter.mjs.map +1 -1
- package/fesm2022/nxt-pick-datetime-native-adapter.mjs +7 -24
- package/fesm2022/nxt-pick-datetime-native-adapter.mjs.map +1 -1
- package/fesm2022/nxt-pick-datetime.mjs +718 -526
- package/fesm2022/nxt-pick-datetime.mjs.map +1 -1
- package/package.json +10 -11
- package/types/nxt-pick-datetime-moment-adapter.d.ts +1 -8
- package/types/nxt-pick-datetime-native-adapter.d.ts +1 -9
- package/types/nxt-pick-datetime.d.ts +12 -12
package/assets/picker.scss
CHANGED
|
@@ -92,6 +92,7 @@ $backdrop-animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
.cdk-overlay-transparent-backdrop {
|
|
95
|
+
|
|
95
96
|
// Note: as of Firefox 57, having the backdrop be `background: none` will prevent it from
|
|
96
97
|
// capturing the user's mouse scroll events. Since we also can't use something like
|
|
97
98
|
// `rgba(0, 0, 0, 0)`, we work around the inconsistency by not setting the background at
|
|
@@ -314,21 +315,21 @@ $theme-color: #3f51b5;
|
|
|
314
315
|
.nxt-dt-calendar-cell-disabled {
|
|
315
316
|
cursor: default;
|
|
316
317
|
|
|
317
|
-
|
|
318
|
+
&>.nxt-dt-calendar-cell-content:not(.nxt-dt-calendar-cell-selected) {
|
|
318
319
|
color: rgb(0, 0, 0, 0.4);
|
|
319
320
|
}
|
|
320
321
|
|
|
321
|
-
|
|
322
|
+
&>.nxt-dt-calendar-cell-content.nxt-dt-calendar-cell-selected {
|
|
322
323
|
opacity: 0.4;
|
|
323
324
|
}
|
|
324
325
|
|
|
325
|
-
|
|
326
|
+
&>.nxt-dt-calendar-cell-today:not(.nxt-dt-calendar-cell-selected) {
|
|
326
327
|
border-color: rgb(0, 0, 0, 0.2);
|
|
327
328
|
}
|
|
328
329
|
}
|
|
329
330
|
|
|
330
|
-
.nxt-dt-calendar-cell-active:focus
|
|
331
|
-
:not(.nxt-dt-calendar-cell-disabled):hover
|
|
331
|
+
.nxt-dt-calendar-cell-active:focus>.nxt-dt-calendar-cell-content:not(.nxt-dt-calendar-cell-selected),
|
|
332
|
+
:not(.nxt-dt-calendar-cell-disabled):hover>.nxt-dt-calendar-cell-content:not(.nxt-dt-calendar-cell-selected) {
|
|
332
333
|
background-color: rgb(0, 0, 0, 0.04);
|
|
333
334
|
}
|
|
334
335
|
|
|
@@ -454,7 +455,7 @@ $theme-color: #3f51b5;
|
|
|
454
455
|
transition: background-color 100ms linear;
|
|
455
456
|
}
|
|
456
457
|
|
|
457
|
-
&:hover
|
|
458
|
+
&:hover>.nxt-dt-control-button-content {
|
|
458
459
|
background-color: rgb(0, 0, 0, 0.12);
|
|
459
460
|
}
|
|
460
461
|
|
|
@@ -511,7 +512,8 @@ $theme-color: #3f51b5;
|
|
|
511
512
|
|
|
512
513
|
.nxt-dt-calendar {
|
|
513
514
|
min-width: 250px;
|
|
514
|
-
|
|
515
|
+
|
|
516
|
+
//min-height: 330px;
|
|
515
517
|
max-width: 750px;
|
|
516
518
|
max-height: 750px;
|
|
517
519
|
}
|
|
@@ -522,7 +524,7 @@ $theme-color: #3f51b5;
|
|
|
522
524
|
}
|
|
523
525
|
}
|
|
524
526
|
|
|
525
|
-
@media all and (orientation: landscape) {
|
|
527
|
+
/* @media all and (orientation: landscape) {
|
|
526
528
|
.nxt-dt-dialog-container {
|
|
527
529
|
.nxt-dt-calendar {
|
|
528
530
|
width: 58vh;
|
|
@@ -546,7 +548,7 @@ $theme-color: #3f51b5;
|
|
|
546
548
|
width: 80vw;
|
|
547
549
|
}
|
|
548
550
|
}
|
|
549
|
-
}
|
|
551
|
+
} */
|
|
550
552
|
|
|
551
553
|
.nxt-dt-container-buttons {
|
|
552
554
|
display: flex;
|
|
@@ -652,11 +654,11 @@ $theme-color: #3f51b5;
|
|
|
652
654
|
outline: none;
|
|
653
655
|
}
|
|
654
656
|
|
|
655
|
-
&:focus
|
|
657
|
+
&:focus>.nxt-dt-control-content {
|
|
656
658
|
background-color: rgb(0, 0, 0, 0.12);
|
|
657
659
|
}
|
|
658
660
|
|
|
659
|
-
&:not(:-moz-focusring):focus
|
|
661
|
+
&:not(:-moz-focusring):focus>.nxt-dt-control-content {
|
|
660
662
|
box-shadow: none;
|
|
661
663
|
}
|
|
662
664
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, LOCALE_ID, Injectable
|
|
2
|
+
import { InjectionToken, inject, LOCALE_ID, Injectable } from '@angular/core';
|
|
3
3
|
import moment from 'moment';
|
|
4
4
|
import { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime';
|
|
5
5
|
|
|
@@ -203,10 +203,10 @@ class MomentDateTimeAdapter extends DateTimeAdapter {
|
|
|
203
203
|
createMoment(...args) {
|
|
204
204
|
return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);
|
|
205
205
|
}
|
|
206
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
207
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
206
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MomentDateTimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
207
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MomentDateTimeAdapter }); }
|
|
208
208
|
}
|
|
209
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
209
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: MomentDateTimeAdapter, decorators: [{
|
|
210
210
|
type: Injectable
|
|
211
211
|
}], ctorParameters: () => [] });
|
|
212
212
|
|
|
@@ -236,26 +236,10 @@ function provideMomentDateTimeAdapter() {
|
|
|
236
236
|
}
|
|
237
237
|
];
|
|
238
238
|
}
|
|
239
|
-
/** @deprecated use provideMomentDateTimeAdapter */
|
|
240
|
-
class MomentDateTimeModule {
|
|
241
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: MomentDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
242
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: MomentDateTimeModule }); }
|
|
243
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: MomentDateTimeModule, providers: [
|
|
244
|
-
provideMomentDateTimeAdapter()
|
|
245
|
-
] }); }
|
|
246
|
-
}
|
|
247
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: MomentDateTimeModule, decorators: [{
|
|
248
|
-
type: NgModule,
|
|
249
|
-
args: [{
|
|
250
|
-
providers: [
|
|
251
|
-
provideMomentDateTimeAdapter()
|
|
252
|
-
]
|
|
253
|
-
}]
|
|
254
|
-
}] });
|
|
255
239
|
|
|
256
240
|
/**
|
|
257
241
|
* Generated bundle index. Do not edit.
|
|
258
242
|
*/
|
|
259
243
|
|
|
260
|
-
export {
|
|
244
|
+
export { NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS, provideMomentDateTimeAdapter };
|
|
261
245
|
//# 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 } 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>('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 private readonly options = inject(NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS, { optional: true })\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 const dateTimeLocale = inject(LOCALE_ID, { optional: true })\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/** @deprecated use provideMomentDateTimeAdapter */\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,CAA+B,sCAAsC,EAAE;AACzI,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AAED;SACgB,4CAA4C,GAAA;IACxD,OAAO;AACH,QAAA,MAAM,EAAE;KACX;AACL;A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A,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,EAAA,SAAA,EAJlB;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;;;ACxBD;;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/public-api.ts","../../../packages/pick-datetime/moment-adapter/src/nxt-pick-datetime-moment-adapter.ts"],"sourcesContent":["import { inject, Injectable, InjectionToken, LOCALE_ID } 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>('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 private readonly options = inject(NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS, { optional: true })\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 const dateTimeLocale = inject(LOCALE_ID, { optional: true })\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","export { MomentDateTimeAdapterOptions, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS } from './date-time-adapter.class'\nimport { LOCALE_ID, Provider } 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\nexport function provideMomentDateTimeAdapter(): Provider[] {\n return [\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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AAE,oCAAoC;AACzD,SAAA;AACD,QAAA;AACI,YAAA,OAAO,EAAE,qBAAqB;AAC9B,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;;AClBA;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Platform, PlatformModule } from '@angular/cdk/platform';
|
|
2
|
-
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, LOCALE_ID, Injectable, NgModule } from '@angular/core';
|
|
4
1
|
import { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime';
|
|
2
|
+
import { Platform } from '@angular/cdk/platform';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, LOCALE_ID, Injectable } from '@angular/core';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The default month names to use if Intl API is not available.
|
|
@@ -355,10 +355,10 @@ class NativeDateTimeAdapter extends DateTimeAdapter {
|
|
|
355
355
|
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
|
356
356
|
return dtf.format(d);
|
|
357
357
|
}
|
|
358
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
359
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
358
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NativeDateTimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
359
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NativeDateTimeAdapter }); }
|
|
360
360
|
}
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NativeDateTimeAdapter, decorators: [{
|
|
362
362
|
type: Injectable
|
|
363
363
|
}], ctorParameters: () => [] });
|
|
364
364
|
|
|
@@ -387,27 +387,10 @@ function provideNativeDateTimeAdapter() {
|
|
|
387
387
|
}
|
|
388
388
|
];
|
|
389
389
|
}
|
|
390
|
-
/** @deprecated use provideNativeDateTimeAdapter */
|
|
391
|
-
class NativeDateTimeModule {
|
|
392
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: NativeDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
393
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.0.8", ngImport: i0, type: NativeDateTimeModule, imports: [PlatformModule] }); }
|
|
394
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: NativeDateTimeModule, providers: [
|
|
395
|
-
provideNativeDateTimeAdapter()
|
|
396
|
-
], imports: [PlatformModule] }); }
|
|
397
|
-
}
|
|
398
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: NativeDateTimeModule, decorators: [{
|
|
399
|
-
type: NgModule,
|
|
400
|
-
args: [{
|
|
401
|
-
imports: [PlatformModule],
|
|
402
|
-
providers: [
|
|
403
|
-
provideNativeDateTimeAdapter()
|
|
404
|
-
]
|
|
405
|
-
}]
|
|
406
|
-
}] });
|
|
407
390
|
|
|
408
391
|
/**
|
|
409
392
|
* Generated bundle index. Do not edit.
|
|
410
393
|
*/
|
|
411
394
|
|
|
412
|
-
export {
|
|
395
|
+
export { provideNativeDateTimeAdapter };
|
|
413
396
|
//# 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'\r\nimport { inject, Injectable, LOCALE_ID } 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 const platform = inject(Platform)\r\n const dateTimeLocale = inject(LOCALE_ID, { optional: true })\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/** @deprecated use provideNativeDateTimeAdapter */\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,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL;AACH,KAAA;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,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AA,CAAA,CAAA;;2FAKf,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBANhC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,cAAc,CAAC;AACzB,oBAAA,SAAS,EAAE;AACP,wBAAA,4BAA4B;AAC/B;AACJ,iBAAA;;;ACzBD;;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/public-api.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 } 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 const platform = inject(Platform)\r\n const dateTimeLocale = inject(LOCALE_ID, { optional: true })\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 { Provider } 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\nexport function provideNativeDateTimeAdapter(): Provider[] {\n return [\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}\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,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL;AACH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