nxt-pick-datetime 14.0.0 → 16.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.
Files changed (86) hide show
  1. package/README.md +34 -202
  2. package/assets/picker.scss +131 -126
  3. package/esm2020/lib/class/date-time-adapter.class.mjs +5 -20
  4. package/esm2020/lib/class/date-time-format.class.mjs +3 -3
  5. package/esm2020/lib/class/date-time.class.mjs +37 -103
  6. package/esm2020/lib/class/dialog-config.class.mjs +14 -23
  7. package/esm2020/lib/class/dialog-ref.class.mjs +11 -13
  8. package/esm2020/lib/date-time/calendar/calendar.component.mjs +97 -96
  9. package/esm2020/lib/date-time/calendar-body/calendar-body.component.mjs +40 -34
  10. package/esm2020/lib/date-time/calendar-month-view/calendar-month-view.component.mjs +92 -101
  11. package/esm2020/lib/date-time/calendar-multi-year-view/calendar-multi-year-view.component.mjs +85 -86
  12. package/esm2020/lib/date-time/calendar-year-view/calendar-year-view.component.mjs +80 -87
  13. package/esm2020/lib/date-time/date-time-inline/date-time-inline.component.mjs +95 -84
  14. package/esm2020/lib/date-time/date-time-picker/date-time-picker.component.mjs +221 -209
  15. package/esm2020/lib/date-time/date-time-picker-container/date-time-picker-container.animations.mjs +3 -2
  16. package/esm2020/lib/date-time/date-time-picker-container/date-time-picker-container.component.mjs +125 -126
  17. package/esm2020/lib/date-time/date-time-picker-input.directive.mjs +215 -221
  18. package/esm2020/lib/date-time/date-time-picker-intl.service.mjs +13 -13
  19. package/esm2020/lib/date-time/date-time-picker-trigger.directive.mjs +21 -19
  20. package/esm2020/lib/date-time/date-time.module.mjs +79 -68
  21. package/esm2020/lib/date-time/number-fixed-len.pipe.mjs +10 -13
  22. package/esm2020/lib/date-time/timer/timer.component.mjs +70 -63
  23. package/esm2020/lib/date-time/timer-box/timer-box.component.mjs +24 -17
  24. package/esm2020/lib/dialog/dialog-container/dialog-container.component.mjs +55 -50
  25. package/esm2020/lib/dialog/dialog.module.mjs +27 -16
  26. package/esm2020/lib/dialog/dialog.service.mjs +66 -54
  27. package/esm2020/lib/utils/object.mjs +5 -3
  28. package/esm2020/moment-adapter/date-time-adapter.class.mjs +26 -21
  29. package/esm2020/moment-adapter/date-time-format.class.mjs +5 -2
  30. package/esm2020/moment-adapter/moment-adapter.module.mjs +19 -23
  31. package/esm2020/moment-adapter/nxt-pick-datetime-moment-adapter.mjs +1 -1
  32. package/esm2020/moment-adapter/public-api.mjs +3 -2
  33. package/esm2020/native-adapter/date-time-adapter.class.mjs +41 -19
  34. package/esm2020/native-adapter/date-time-format.class.mjs +5 -2
  35. package/esm2020/native-adapter/native-adapter.module.mjs +23 -21
  36. package/esm2020/native-adapter/nxt-pick-datetime-native-adapter.mjs +1 -1
  37. package/esm2020/native-adapter/public-api.mjs +2 -2
  38. package/esm2020/nxt-pick-datetime.mjs +1 -1
  39. package/esm2020/public-api.mjs +14 -14
  40. package/fesm2015/nxt-pick-datetime-moment-adapter.mjs +44 -40
  41. package/fesm2015/nxt-pick-datetime-moment-adapter.mjs.map +1 -1
  42. package/fesm2015/nxt-pick-datetime-native-adapter.mjs +65 -38
  43. package/fesm2015/nxt-pick-datetime-native-adapter.mjs.map +1 -1
  44. package/fesm2015/nxt-pick-datetime.mjs +1492 -1447
  45. package/fesm2015/nxt-pick-datetime.mjs.map +1 -1
  46. package/fesm2020/nxt-pick-datetime-moment-adapter.mjs +44 -40
  47. package/fesm2020/nxt-pick-datetime-moment-adapter.mjs.map +1 -1
  48. package/fesm2020/nxt-pick-datetime-native-adapter.mjs +65 -38
  49. package/fesm2020/nxt-pick-datetime-native-adapter.mjs.map +1 -1
  50. package/fesm2020/nxt-pick-datetime.mjs +1422 -1437
  51. package/fesm2020/nxt-pick-datetime.mjs.map +1 -1
  52. package/lib/class/date-time-adapter.class.d.ts +31 -41
  53. package/lib/class/date-time-format.class.d.ts +3 -3
  54. package/lib/class/date-time.class.d.ts +39 -51
  55. package/lib/class/dialog-config.class.d.ts +27 -27
  56. package/lib/class/dialog-ref.class.d.ts +21 -22
  57. package/lib/date-time/calendar/calendar.component.d.ts +66 -60
  58. package/lib/date-time/calendar-body/calendar-body.component.d.ts +22 -20
  59. package/lib/date-time/calendar-month-view/calendar-month-view.component.d.ts +57 -56
  60. package/lib/date-time/calendar-multi-year-view/calendar-multi-year-view.component.d.ts +58 -52
  61. package/lib/date-time/calendar-year-view/calendar-year-view.component.d.ts +51 -48
  62. package/lib/date-time/date-time-inline/date-time-inline.component.d.ts +69 -53
  63. package/lib/date-time/date-time-picker/date-time-picker.component.d.ts +106 -91
  64. package/lib/date-time/date-time-picker-container/date-time-picker-container.animations.d.ts +2 -1
  65. package/lib/date-time/date-time-picker-container/date-time-picker-container.component.d.ts +54 -47
  66. package/lib/date-time/date-time-picker-input.directive.d.ts +93 -78
  67. package/lib/date-time/date-time-picker-intl.service.d.ts +11 -11
  68. package/lib/date-time/date-time-picker-trigger.directive.d.ts +10 -9
  69. package/lib/date-time/date-time.module.d.ts +4 -4
  70. package/lib/date-time/number-fixed-len.pipe.d.ts +2 -1
  71. package/lib/date-time/timer/timer.component.d.ts +32 -30
  72. package/lib/date-time/timer-box/timer-box.component.d.ts +13 -11
  73. package/lib/dialog/dialog-container/dialog-container.component.d.ts +40 -27
  74. package/lib/dialog/dialog.module.d.ts +5 -4
  75. package/lib/dialog/dialog.service.d.ts +42 -35
  76. package/lib/utils/object.d.ts +2 -0
  77. package/moment-adapter/date-time-adapter.class.d.ts +13 -13
  78. package/moment-adapter/date-time-format.class.d.ts +5 -2
  79. package/moment-adapter/moment-adapter.module.d.ts +0 -5
  80. package/moment-adapter/public-api.d.ts +2 -1
  81. package/native-adapter/date-time-adapter.class.d.ts +7 -7
  82. package/native-adapter/date-time-format.class.d.ts +5 -2
  83. package/native-adapter/native-adapter.module.d.ts +0 -5
  84. package/native-adapter/public-api.d.ts +1 -1
  85. package/package.json +13 -11
  86. package/public-api.d.ts +14 -13
@@ -1,20 +1,24 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, Injectable, Optional, Inject, NgModule } from '@angular/core';
3
- import { DateTimeAdapter, OWL_DATE_TIME_LOCALE, OWL_DATE_TIME_FORMATS } from 'nxt-pick-datetime';
2
+ import { InjectionToken, LOCALE_ID, Injectable, Optional, Inject, NgModule } from '@angular/core';
4
3
  import moment from 'moment';
4
+ import { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime';
5
5
 
6
- /** InjectionToken for moment date adapter to configure options. */
7
- const OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS = new InjectionToken('OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS', {
6
+ /** InjectionToken for moment date adapter to configure options */
7
+ const NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS = new InjectionToken('NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS', {
8
8
  providedIn: 'root',
9
- factory: OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY
9
+ factory: NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY
10
10
  });
11
- /** @docs-private */
12
- function OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY() {
11
+ /** @internal */
12
+ function NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY() {
13
13
  return {
14
14
  useUtc: false
15
15
  };
16
16
  }
17
- /** Creates an array and fills it with values. */
17
+ /**
18
+ * Creates an array and fills it with values.
19
+ *
20
+ * @internal
21
+ */
18
22
  function range(length, valueFunction) {
19
23
  const valuesArray = Array(length);
20
24
  for (let i = 0; i < length; i++) {
@@ -23,10 +27,11 @@ function range(length, valueFunction) {
23
27
  return valuesArray;
24
28
  }
25
29
  class MomentDateTimeAdapter extends DateTimeAdapter {
26
- constructor(owlDateTimeLocale, options) {
30
+ constructor(dateTimeLocale, options) {
27
31
  super();
28
32
  this.options = options;
29
- this.setLocale(owlDateTimeLocale || moment.locale());
33
+ this._localeData = {};
34
+ this.setLocale(dateTimeLocale || moment.locale());
30
35
  }
31
36
  setLocale(locale) {
32
37
  super.setLocale(locale);
@@ -170,12 +175,12 @@ class MomentDateTimeAdapter extends DateTimeAdapter {
170
175
  if (value && typeof value === 'string') {
171
176
  return this.createMoment(value, parseFormat, this.locale);
172
177
  }
173
- return value ? this.createMoment(value).locale(this.locale) : null;
178
+ return value ? this.createMoment(value).locale(this.locale) : undefined;
174
179
  }
175
180
  /**
176
- * Returns the given value if given a valid Moment or null. Deserializes valid ISO 8601 strings
181
+ * Returns the given value if given a valid Moment or undefined. Deserializes valid ISO 8601 strings
177
182
  * (https://www.ietf.org/rfc/rfc3339.txt) and valid Date objects into valid Moments and empty
178
- * string into null. Returns an invalid date for all other values.
183
+ * string into undefined. Returns an invalid date for all other values.
179
184
  */
180
185
  deserialize(value) {
181
186
  let date;
@@ -184,7 +189,7 @@ class MomentDateTimeAdapter extends DateTimeAdapter {
184
189
  }
185
190
  if (typeof value === 'string') {
186
191
  if (!value) {
187
- return null;
192
+ return undefined;
188
193
  }
189
194
  date = this.createMoment(value, moment.ISO_8601).locale(this.locale);
190
195
  }
@@ -193,28 +198,31 @@ class MomentDateTimeAdapter extends DateTimeAdapter {
193
198
  }
194
199
  return super.deserialize(value);
195
200
  }
196
- /** Creates a Moment instance while respecting the current UTC settings. */
201
+ /** Creates a Moment instance while respecting the current UTC settings */
197
202
  createMoment(...args) {
198
203
  return (this.options && this.options.useUtc) ? moment.utc(...args) : moment(...args);
199
204
  }
200
205
  }
201
- MomentDateTimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MomentDateTimeAdapter, deps: [{ token: OWL_DATE_TIME_LOCALE, optional: true }, { token: OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
202
- MomentDateTimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MomentDateTimeAdapter });
203
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MomentDateTimeAdapter, decorators: [{
206
+ MomentDateTimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MomentDateTimeAdapter, deps: [{ token: LOCALE_ID, optional: true }, { token: NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
207
+ MomentDateTimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MomentDateTimeAdapter });
208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MomentDateTimeAdapter, decorators: [{
204
209
  type: Injectable
205
210
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
206
211
  type: Optional
207
212
  }, {
208
213
  type: Inject,
209
- args: [OWL_DATE_TIME_LOCALE]
214
+ args: [LOCALE_ID]
210
215
  }] }, { type: undefined, decorators: [{
211
216
  type: Optional
212
217
  }, {
213
218
  type: Inject,
214
- args: [OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
219
+ args: [NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
215
220
  }] }]; } });
216
221
 
217
- const OWL_MOMENT_DATE_TIME_FORMATS = {
222
+ /**
223
+ * @internal
224
+ */
225
+ const NXT_MOMENT_DATE_TIME_FORMATS = {
218
226
  parseInput: 'l LT',
219
227
  fullPickerInput: 'l LT',
220
228
  datePickerInput: 'l',
@@ -226,43 +234,39 @@ const OWL_MOMENT_DATE_TIME_FORMATS = {
226
234
 
227
235
  class MomentDateTimeModule {
228
236
  }
229
- MomentDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MomentDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
230
- MomentDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: MomentDateTimeModule });
231
- MomentDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MomentDateTimeModule, providers: [
237
+ MomentDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MomentDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
238
+ MomentDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: MomentDateTimeModule });
239
+ MomentDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MomentDateTimeModule, providers: [
232
240
  {
233
241
  provide: DateTimeAdapter,
234
242
  useClass: MomentDateTimeAdapter,
235
- deps: [OWL_DATE_TIME_LOCALE, OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
243
+ deps: [LOCALE_ID, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
244
+ },
245
+ {
246
+ provide: NXT_DATE_TIME_FORMATS,
247
+ useValue: NXT_MOMENT_DATE_TIME_FORMATS
236
248
  }
237
249
  ] });
238
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: MomentDateTimeModule, decorators: [{
250
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MomentDateTimeModule, decorators: [{
239
251
  type: NgModule,
240
252
  args: [{
241
253
  providers: [
242
254
  {
243
255
  provide: DateTimeAdapter,
244
256
  useClass: MomentDateTimeAdapter,
245
- deps: [OWL_DATE_TIME_LOCALE, OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS]
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
246
262
  }
247
263
  ]
248
264
  }]
249
- }] });
250
- class OwlMomentDateTimeModule {
251
- }
252
- OwlMomentDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OwlMomentDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
253
- OwlMomentDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: OwlMomentDateTimeModule, imports: [MomentDateTimeModule] });
254
- OwlMomentDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OwlMomentDateTimeModule, providers: [{ provide: OWL_DATE_TIME_FORMATS, useValue: OWL_MOMENT_DATE_TIME_FORMATS }], imports: [MomentDateTimeModule] });
255
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OwlMomentDateTimeModule, decorators: [{
256
- type: NgModule,
257
- args: [{
258
- imports: [MomentDateTimeModule],
259
- providers: [{ provide: OWL_DATE_TIME_FORMATS, useValue: OWL_MOMENT_DATE_TIME_FORMATS }]
260
- }]
261
265
  }] });
262
266
 
263
267
  /**
264
268
  * Generated bundle index. Do not edit.
265
269
  */
266
270
 
267
- export { OwlMomentDateTimeModule };
271
+ export { MomentDateTimeModule, NXT_MOMENT_DATE_TIME_ADAPTER_OPTIONS };
268
272
  //# sourceMappingURL=nxt-pick-datetime-moment-adapter.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"nxt-pick-datetime-moment-adapter.mjs","sources":["../../../projects/nxt-pick-datetime/moment-adapter/src/date-time-adapter.class.ts","../../../projects/nxt-pick-datetime/moment-adapter/src/date-time-format.class.ts","../../../projects/nxt-pick-datetime/moment-adapter/src/moment-adapter.module.ts","../../../projects/nxt-pick-datetime/moment-adapter/src/nxt-pick-datetime-moment-adapter.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'\nimport moment, { Moment } from 'moment'\nimport { DateTimeAdapter, OWL_DATE_TIME_LOCALE } from 'nxt-pick-datetime'\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport interface OwlMomentDateTimeAdapterOptions {\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 OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS = new InjectionToken<OwlMomentDateTimeAdapterOptions>(\n 'OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS', {\n providedIn: 'root',\n factory: OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY\n })\n\n/** @docs-private */\nexport function OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS_FACTORY(): OwlMomentDateTimeAdapterOptions {\n return {\n useUtc: false\n }\n}\n\n/** Creates an array and fills it with values. */\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 }\n\n constructor(\n @Optional() @Inject(OWL_DATE_TIME_LOCALE)\n owlDateTimeLocale?: string,\n @Optional() @Inject(OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS)\n private options?: OwlMomentDateTimeAdapterOptions\n ) {\n super()\n this.setLocale(owlDateTimeLocale || moment.locale())\n }\n\n public 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 public getYear(date: Moment): number {\n return this.clone(date).year()\n }\n\n public getMonth(date: Moment): number {\n return this.clone(date).month()\n }\n\n public getDay(date: Moment): number {\n return this.clone(date).day()\n }\n\n public getDate(date: Moment): number {\n return this.clone(date).date()\n }\n\n public getHours(date: Moment): number {\n return this.clone(date).hours()\n }\n\n public getMinutes(date: Moment): number {\n return this.clone(date).minutes()\n }\n\n public getSeconds(date: Moment): number {\n return this.clone(date).seconds()\n }\n\n public getTime(date: Moment): number {\n return this.clone(date).valueOf()\n }\n\n public getNumDaysInMonth(date: Moment): number {\n return this.clone(date).daysInMonth()\n }\n\n public differenceInCalendarDays(dateLeft: Moment, dateRight: Moment): number {\n return this.clone(dateLeft).diff(dateRight, 'days')\n }\n\n public getYearName(date: Moment): string {\n return this.clone(date).format('YYYY')\n }\n\n public getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n return style === 'long' ? this._localeData.longMonths : this._localeData.shortMonths\n }\n\n public 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 public getDateNames(): string[] {\n return this._localeData.dates\n }\n\n public toIso8601(date: Moment): string {\n return this.clone(date).format()\n }\n\n public 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 public 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 public isValid(date: Moment): boolean {\n return this.clone(date).isValid()\n }\n\n public invalid(): Moment {\n return moment.invalid()\n }\n\n public isDateInstance(obj: any): boolean {\n return moment.isMoment(obj)\n }\n\n public addCalendarYears(date: Moment, amount: number): Moment {\n return this.clone(date).add({ years: amount })\n }\n\n public addCalendarMonths(date: Moment, amount: number): Moment {\n return this.clone(date).add({ months: amount })\n }\n\n public addCalendarDays(date: Moment, amount: number): Moment {\n return this.clone(date).add({ days: amount })\n }\n\n public setHours(date: Moment, amount: number): Moment {\n return this.clone(date).hours(amount)\n }\n\n public setMinutes(date: Moment, amount: number): Moment {\n return this.clone(date).minutes(amount)\n }\n\n public setSeconds(date: Moment, amount: number): Moment {\n return this.clone(date).seconds(amount)\n }\n\n public createDate(year: number, month: number, date: number): Moment\n public 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 public clone(date: Moment): Moment {\n return this.createMoment(date).clone().locale(this.locale)\n }\n\n public now(): Moment {\n return this.createMoment().locale(this.locale)\n }\n\n public 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 public parse(value: any, parseFormat: any): Moment | null {\n if (value && typeof value === 'string') {\n return this.createMoment(value, parseFormat, this.locale)\n }\n return value ? this.createMoment(value).locale(this.locale) : null\n }\n\n /**\n * Returns the given value if given a valid Moment or null. 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 null. Returns an invalid date for all other values.\n */\n deserialize(value: any): Moment | null {\n let date\n if (value instanceof Date) {\n date = this.createMoment(value)\n }\n if (typeof value === 'string') {\n if (!value) {\n return null\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 { OwlDateTimeFormats } from 'nxt-pick-datetime'\n\nexport const OWL_MOMENT_DATE_TIME_FORMATS: OwlDateTimeFormats = {\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 { NgModule } from '@angular/core'\nimport { DateTimeAdapter, OWL_DATE_TIME_FORMATS, OWL_DATE_TIME_LOCALE } from 'nxt-pick-datetime'\nimport { MomentDateTimeAdapter, OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS } from './date-time-adapter.class'\nimport { OWL_MOMENT_DATE_TIME_FORMATS } from './date-time-format.class'\n\n@NgModule({\n providers: [\n {\n provide: DateTimeAdapter,\n useClass: MomentDateTimeAdapter,\n deps: [OWL_DATE_TIME_LOCALE, OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS]\n }\n ]\n})\nexport class MomentDateTimeModule { }\n\n@NgModule({\n imports: [MomentDateTimeModule],\n providers: [{ provide: OWL_DATE_TIME_FORMATS, useValue: OWL_MOMENT_DATE_TIME_FORMATS }]\n})\nexport class OwlMomentDateTimeModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAcA;AACO,MAAM,oCAAoC,GAAG,IAAI,cAAc,CAClE,sCAAsC,EAAE;AACpC,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,4CAA4C;AACxD,CAAA,CAAC,CAAA;AAEN;SACgB,4CAA4C,GAAA;IACxD,OAAO;AACH,QAAA,MAAM,EAAE,KAAK;KAChB,CAAA;AACL,CAAC;AAED;AACA,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,WAEI,CAAA,iBAA0B,EAElB,OAAyC,EAAA;AAEjD,QAAA,KAAK,EAAE,CAAA;QAFC,IAAO,CAAA,OAAA,GAAP,OAAO,CAAkC;QAGjD,IAAI,CAAC,SAAS,CAAC,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;KACvD;AAEM,IAAA,SAAS,CAAC,MAAc,EAAA;AAC3B,QAAA,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QAEvB,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QAClD,IAAI,CAAC,WAAW,GAAG;AACf,YAAA,UAAU,EAAE,gBAAgB,CAAC,MAAM,EAAE;AACrC,YAAA,WAAW,EAAE,gBAAgB,CAAC,WAA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HAAvB,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAvB,uBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YANvB,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAMpB,uBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,EAFrB,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,EAAE,CAAC,YAD7E,oBAAoB,CAAA,EAAA,CAAA,CAAA;4FAGrB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,EAAE,CAAC;AAC1F,iBAAA,CAAA;;;ACnBD;;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'\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;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angular/core';
4
- import { Injectable, Optional, Inject, NgModule } from '@angular/core';
5
- import { DateTimeAdapter, OWL_DATE_TIME_LOCALE, OWL_DATE_TIME_FORMATS } from 'nxt-pick-datetime';
4
+ import { LOCALE_ID, Injectable, Optional, Inject, NgModule } from '@angular/core';
5
+ import { DateTimeAdapter, NXT_DATE_TIME_FORMATS } from 'nxt-pick-datetime';
6
6
 
7
- /** The default month names to use if Intl API is not available. */
7
+ /**
8
+ * The default month names to use if Intl API is not available.
9
+ *
10
+ * @internal
11
+ */
8
12
  const DEFAULT_MONTH_NAMES = {
9
13
  long: [
10
14
  'January',
@@ -36,7 +40,11 @@ const DEFAULT_MONTH_NAMES = {
36
40
  ],
37
41
  narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D']
38
42
  };
39
- /** The default day of the week names to use if Intl API is not available. */
43
+ /**
44
+ * The default day of the week names to use if Intl API is not available.
45
+ *
46
+ * @internal
47
+ */
40
48
  const DEFAULT_DAY_OF_WEEK_NAMES = {
41
49
  long: [
42
50
  'Sunday',
@@ -50,17 +58,31 @@ const DEFAULT_DAY_OF_WEEK_NAMES = {
50
58
  short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
51
59
  narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
52
60
  };
53
- /** The default date names to use if Intl API is not available. */
61
+ /**
62
+ * The default date names to use if Intl API is not available.
63
+ *
64
+ * @internal
65
+ */
54
66
  const DEFAULT_DATE_NAMES = range(31, i => String(i + 1));
55
- /** Whether the browser supports the Intl API. */
67
+ /**
68
+ * Whether the browser supports the Intl API.
69
+ *
70
+ * @internal
71
+ */
56
72
  const SUPPORTS_INTL_API = typeof Intl !== 'undefined';
57
73
  /**
58
74
  * Matches strings that have the form of a valid RFC 3339 string
59
75
  * (https://tools.ietf.org/html/rfc3339). Note that the string may not actually be a valid date
60
76
  * because the regex will match strings an with out of bounds month, date, etc.
77
+ *
78
+ * @internal
61
79
  */
62
80
  const ISO_8601_REGEX = /^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|(?:(?:\+|-)\d{2}:\d{2}))?)?$/;
63
- /** Creates an array and fills it with values. */
81
+ /**
82
+ * Creates an array and fills it with values.
83
+ *
84
+ * @internal
85
+ */
64
86
  function range(length, valueFunction) {
65
87
  const valuesArray = Array(length);
66
88
  for (let i = 0; i < length; i++) {
@@ -69,9 +91,9 @@ function range(length, valueFunction) {
69
91
  return valuesArray;
70
92
  }
71
93
  class NativeDateTimeAdapter extends DateTimeAdapter {
72
- constructor(platform, owlDateTimeLocale) {
94
+ constructor(platform, dateTimeLocale) {
73
95
  super();
74
- super.setLocale(owlDateTimeLocale);
96
+ super.setLocale(dateTimeLocale);
75
97
  // IE does its own time zone correction, so we disable this on IE.
76
98
  this.useUtcForDisplay = !platform.TRIDENT;
77
99
  this._clampDate = platform.TRIDENT || platform.EDGE;
@@ -117,7 +139,7 @@ class NativeDateTimeAdapter extends DateTimeAdapter {
117
139
  return Math.round((timeStampLeft - timeStampRight) / this.millisecondsInDay);
118
140
  }
119
141
  else {
120
- return null;
142
+ return undefined;
121
143
  }
122
144
  }
123
145
  getYearName(date) {
@@ -280,17 +302,17 @@ class NativeDateTimeAdapter extends DateTimeAdapter {
280
302
  if (typeof value === 'number') {
281
303
  return new Date(value);
282
304
  }
283
- return value ? new Date(Date.parse(value)) : null;
305
+ return value ? new Date(Date.parse(value)) : undefined;
284
306
  }
285
307
  /**
286
- * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings
287
- * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an
308
+ * Returns the given value if given a valid Date or undefined. Deserializes valid ISO 8601 strings
309
+ * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into undefined. Returns an
288
310
  * invalid date for all other values.
289
311
  */
290
312
  deserialize(value) {
291
313
  if (typeof value === 'string') {
292
314
  if (!value) {
293
- return null;
315
+ return undefined;
294
316
  }
295
317
  // The `Date` constructor accepts formats other than ISO 8601, so we need to make sure the
296
318
  // string is the right format first.
@@ -333,18 +355,21 @@ class NativeDateTimeAdapter extends DateTimeAdapter {
333
355
  return dtf.format(d);
334
356
  }
335
357
  }
336
- NativeDateTimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NativeDateTimeAdapter, deps: [{ token: i1.Platform }, { token: OWL_DATE_TIME_LOCALE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
337
- NativeDateTimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NativeDateTimeAdapter });
338
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NativeDateTimeAdapter, decorators: [{
358
+ NativeDateTimeAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NativeDateTimeAdapter, deps: [{ token: i1.Platform }, { token: LOCALE_ID, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
359
+ NativeDateTimeAdapter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NativeDateTimeAdapter });
360
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NativeDateTimeAdapter, decorators: [{
339
361
  type: Injectable
340
362
  }], ctorParameters: function () { return [{ type: i1.Platform }, { type: undefined, decorators: [{
341
363
  type: Optional
342
364
  }, {
343
365
  type: Inject,
344
- args: [OWL_DATE_TIME_LOCALE]
366
+ args: [LOCALE_ID]
345
367
  }] }]; } });
346
368
 
347
- const OWL_NATIVE_DATE_TIME_FORMATS = {
369
+ /**
370
+ * @internal
371
+ */
372
+ const NXT_NATIVE_DATE_TIME_FORMATS = {
348
373
  parseInput: null,
349
374
  fullPickerInput: { year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' },
350
375
  datePickerInput: { year: 'numeric', month: 'numeric', day: 'numeric' },
@@ -356,36 +381,38 @@ const OWL_NATIVE_DATE_TIME_FORMATS = {
356
381
 
357
382
  class NativeDateTimeModule {
358
383
  }
359
- NativeDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NativeDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
360
- NativeDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: NativeDateTimeModule, imports: [PlatformModule] });
361
- NativeDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NativeDateTimeModule, providers: [
362
- { provide: DateTimeAdapter, useClass: NativeDateTimeAdapter }
384
+ NativeDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NativeDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
385
+ NativeDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.3", ngImport: i0, type: NativeDateTimeModule, imports: [PlatformModule] });
386
+ NativeDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NativeDateTimeModule, providers: [
387
+ {
388
+ provide: DateTimeAdapter,
389
+ useClass: NativeDateTimeAdapter
390
+ },
391
+ {
392
+ provide: NXT_DATE_TIME_FORMATS,
393
+ useValue: NXT_NATIVE_DATE_TIME_FORMATS
394
+ }
363
395
  ], imports: [PlatformModule] });
364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: NativeDateTimeModule, decorators: [{
396
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: NativeDateTimeModule, decorators: [{
365
397
  type: NgModule,
366
398
  args: [{
367
399
  imports: [PlatformModule],
368
400
  providers: [
369
- { provide: DateTimeAdapter, useClass: NativeDateTimeAdapter }
401
+ {
402
+ provide: DateTimeAdapter,
403
+ useClass: NativeDateTimeAdapter
404
+ },
405
+ {
406
+ provide: NXT_DATE_TIME_FORMATS,
407
+ useValue: NXT_NATIVE_DATE_TIME_FORMATS
408
+ }
370
409
  ]
371
410
  }]
372
- }] });
373
- class OwlNativeDateTimeModule {
374
- }
375
- OwlNativeDateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OwlNativeDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
376
- OwlNativeDateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: OwlNativeDateTimeModule, imports: [NativeDateTimeModule] });
377
- OwlNativeDateTimeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OwlNativeDateTimeModule, providers: [{ provide: OWL_DATE_TIME_FORMATS, useValue: OWL_NATIVE_DATE_TIME_FORMATS }], imports: [NativeDateTimeModule] });
378
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: OwlNativeDateTimeModule, decorators: [{
379
- type: NgModule,
380
- args: [{
381
- imports: [NativeDateTimeModule],
382
- providers: [{ provide: OWL_DATE_TIME_FORMATS, useValue: OWL_NATIVE_DATE_TIME_FORMATS }]
383
- }]
384
411
  }] });
385
412
 
386
413
  /**
387
414
  * Generated bundle index. Do not edit.
388
415
  */
389
416
 
390
- export { OwlNativeDateTimeModule };
417
+ export { NativeDateTimeModule };
391
418
  //# sourceMappingURL=nxt-pick-datetime-native-adapter.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"nxt-pick-datetime-native-adapter.mjs","sources":["../../../projects/nxt-pick-datetime/native-adapter/src/date-time-adapter.class.ts","../../../projects/nxt-pick-datetime/native-adapter/src/date-time-format.class.ts","../../../projects/nxt-pick-datetime/native-adapter/src/native-adapter.module.ts","../../../projects/nxt-pick-datetime/native-adapter/src/nxt-pick-datetime-native-adapter.ts"],"sourcesContent":["import { Platform } from '@angular/cdk/platform'\nimport { Inject, Injectable, Optional } from '@angular/core'\nimport { DateTimeAdapter, OWL_DATE_TIME_LOCALE } from 'nxt-pick-datetime'\n\n/** The default month names to use if Intl API is not available. */\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/** The default day of the week names to use if Intl API is not available. */\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/** The default date names to use if Intl API is not available. */\nconst DEFAULT_DATE_NAMES = range(31, i => String(i + 1))\n\n/** Whether the browser supports the Intl API. */\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 */\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/** Creates an array and fills it with values. */\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(OWL_DATE_TIME_LOCALE)\n owlDateTimeLocale?: string\n ) {\n super()\n super.setLocale(owlDateTimeLocale)\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 public getYear(date: Date): number {\n return date.getFullYear()\n }\n\n public getMonth(date: Date): number {\n return date.getMonth()\n }\n\n public getDay(date: Date): number {\n return date.getDay()\n }\n\n public getDate(date: Date): number {\n return date.getDate()\n }\n\n public getHours(date: Date): number {\n return date.getHours()\n }\n\n public getMinutes(date: Date): number {\n return date.getMinutes()\n }\n\n public getSeconds(date: Date): number {\n return date.getSeconds()\n }\n\n public getTime(date: Date): number {\n return date.getTime()\n }\n\n public 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 public differenceInCalendarDays(dateLeft: Date, dateRight: Date): number {\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 null\n }\n }\n\n public 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 public 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 public 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 public 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 public toIso8601(date: Date): string {\n return date.toISOString()\n }\n\n public 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 public 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 public isValid(date: Date): boolean {\n return date && !isNaN(date.getTime())\n }\n\n public invalid(): Date {\n return new Date(NaN)\n }\n\n public isDateInstance(obj: any): boolean {\n return obj instanceof Date\n }\n\n public addCalendarYears(date: Date, amount: number): Date {\n return this.addCalendarMonths(date, amount * 12)\n }\n\n public 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 public 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 public setHours(date: Date, amount: number): Date {\n const result = this.clone(date)\n result.setHours(amount)\n return result\n }\n\n public setMinutes(date: Date, amount: number): Date {\n const result = this.clone(date)\n result.setMinutes(amount)\n return result\n }\n\n public setSeconds(date: Date, amount: number): Date {\n const result = this.clone(date)\n result.setSeconds(amount)\n return result\n }\n\n public 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 public 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 public now(): Date {\n return new Date()\n }\n\n public 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 public parse(value: any, _parseFormat: any): Date | null {\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)) : null\n }\n\n /**\n * Returns the given value if given a valid Date or null. Deserializes valid ISO 8601 strings\n * (https://www.ietf.org/rfc/rfc3339.txt) into valid Dates and empty string into null. Returns an\n * invalid date for all other values.\n */\n public deserialize(value: any): Date | null {\n if (typeof value === 'string') {\n if (!value) {\n return null\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 { OwlDateTimeFormats } from 'nxt-pick-datetime'\n\nexport const OWL_NATIVE_DATE_TIME_FORMATS: OwlDateTimeFormats = {\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, OWL_DATE_TIME_FORMATS } from 'nxt-pick-datetime'\nimport { NativeDateTimeAdapter } from './date-time-adapter.class'\nimport { OWL_NATIVE_DATE_TIME_FORMATS } from './date-time-format.class'\n\n@NgModule({\n imports: [PlatformModule],\n providers: [\n { provide: DateTimeAdapter, useClass: NativeDateTimeAdapter }\n ]\n})\nexport class NativeDateTimeModule { }\n\n@NgModule({\n imports: [NativeDateTimeModule],\n providers: [{ provide: OWL_DATE_TIME_FORMATS, useValue: OWL_NATIVE_DATE_TIME_FORMATS }]\n})\nexport class OwlNativeDateTimeModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAIA;AACA,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,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;CACvE,CAAA;AAED;AACA,MAAM,yBAAyB,GAAG;AAC9B,IAAA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CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,EAFrB,SAAA,EAAA,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,EAAE,CAAC,YAD7E,oBAAoB,CAAA,EAAA,CAAA,CAAA;4FAGrB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,oBAAoB,CAAC;oBAC/B,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,EAAE,CAAC;AAC1F,iBAAA,CAAA;;;ACjBD;;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'\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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