@fundamental-ngx/datetime-adapter 0.63.0-rc.3 → 0.63.0-rc.30
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.
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
2
|
+
import { InjectionToken, inject, LOCALE_ID, Injectable, makeEnvironmentProviders, NgModule } from '@angular/core';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
5
5
|
import isBetween from 'dayjs/plugin/isBetween';
|
|
6
6
|
import localeData from 'dayjs/plugin/localeData';
|
|
7
7
|
import localizedFormat from 'dayjs/plugin/localizedFormat';
|
|
8
8
|
import objectSupport from 'dayjs/plugin/objectSupport';
|
|
9
|
+
import relativeTime from 'dayjs/plugin/relativeTime';
|
|
9
10
|
import utc from 'dayjs/plugin/utc';
|
|
10
11
|
import weekOfYear from 'dayjs/plugin/weekOfYear';
|
|
11
|
-
import { DatetimeAdapter,
|
|
12
|
+
import { DatetimeAdapter, DATE_TIME_FORMATS } from '@fundamental-ngx/core/datetime';
|
|
12
13
|
|
|
14
|
+
// Load plugins once at module level instead of per-instance in the constructor
|
|
15
|
+
dayjs.extend(localeData);
|
|
16
|
+
dayjs.extend(weekOfYear);
|
|
17
|
+
dayjs.extend(utc);
|
|
18
|
+
dayjs.extend(isBetween);
|
|
19
|
+
dayjs.extend(objectSupport);
|
|
20
|
+
dayjs.extend(localizedFormat);
|
|
21
|
+
dayjs.extend(customParseFormat);
|
|
22
|
+
dayjs.extend(relativeTime);
|
|
13
23
|
function range(length, mapFn) {
|
|
14
24
|
return Array.from(new Array(length)).map((_, index) => mapFn(index));
|
|
15
25
|
}
|
|
@@ -32,37 +42,40 @@ function DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY() {
|
|
|
32
42
|
*/
|
|
33
43
|
class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
34
44
|
/** @hidden */
|
|
35
|
-
constructor(
|
|
45
|
+
constructor() {
|
|
36
46
|
super();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
dayjs.extend(utc);
|
|
41
|
-
dayjs.extend(isBetween);
|
|
42
|
-
dayjs.extend(objectSupport);
|
|
43
|
-
dayjs.extend(localizedFormat);
|
|
44
|
-
dayjs.extend(customParseFormat);
|
|
47
|
+
/** @hidden */
|
|
48
|
+
this._options = inject(DAYJS_DATE_TIME_ADAPTER_OPTIONS, { optional: true });
|
|
49
|
+
const localeId = inject(LOCALE_ID, { optional: true });
|
|
45
50
|
this.setLocale(localeId || dayjs.locale());
|
|
46
51
|
}
|
|
52
|
+
/** @hidden */
|
|
53
|
+
fromNow(date) {
|
|
54
|
+
return date.locale(this.locale()).fromNow();
|
|
55
|
+
}
|
|
47
56
|
/** Set locale */
|
|
48
57
|
setLocale(locale) {
|
|
49
58
|
if (locale.toLowerCase() === 'en-us') {
|
|
50
59
|
// Handle English locale name as it's a default one and it is different
|
|
51
60
|
locale = 'en';
|
|
52
61
|
}
|
|
53
|
-
dayjs.locale
|
|
54
|
-
|
|
55
|
-
throw new Error(`Failed to load locale ${locale}. ` +
|
|
62
|
+
if (!dayjs.Ls[locale]) {
|
|
63
|
+
console.warn(`Failed to load locale ${locale}. Falling back to 'en'. ` +
|
|
56
64
|
'Make sure it exists and is preloaded. See the imports at the top of the example file at ' +
|
|
57
|
-
'https://sap.github.io/fundamental-ngx/#/core/dayjs-datetime-adapter' +
|
|
65
|
+
'https://sap.github.io/fundamental-ngx/#/core/dayjs-datetime-adapter ' +
|
|
58
66
|
'List of supported locales can be found here: https://github.com/iamkun/dayjs/tree/dev/src/locale.');
|
|
67
|
+
locale = 'en';
|
|
59
68
|
}
|
|
60
|
-
|
|
69
|
+
// Use a temporary instance to read locale data without mutating global dayjs state.
|
|
70
|
+
this._dayjsLocaleData = dayjs().locale(locale).localeData();
|
|
61
71
|
this._localeData = {
|
|
62
72
|
firstDayOfWeek: this._dayjsLocaleData.firstDayOfWeek(),
|
|
63
73
|
longMonths: this._dayjsLocaleData.months(),
|
|
64
74
|
shortMonths: this._dayjsLocaleData.monthsShort(),
|
|
65
|
-
narrowMonths:
|
|
75
|
+
narrowMonths: (() => {
|
|
76
|
+
const dtf = new Intl.DateTimeFormat(locale, { month: 'narrow' });
|
|
77
|
+
return range(12, (i) => dtf.format(new Date(2017, i, 1)));
|
|
78
|
+
})(),
|
|
66
79
|
longDaysOfWeek: this._dayjsLocaleData.weekdays(),
|
|
67
80
|
shortDaysOfWeek: this._dayjsLocaleData.weekdaysShort(),
|
|
68
81
|
narrowDaysOfWeek: this._dayjsLocaleData.weekdaysMin()
|
|
@@ -127,7 +140,7 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
127
140
|
}
|
|
128
141
|
/** Get date names */
|
|
129
142
|
getDateNames() {
|
|
130
|
-
return range(31, (i) => this.createDate(2017,
|
|
143
|
+
return range(31, (i) => this.createDate(2017, 1, i + 1).format('D'));
|
|
131
144
|
}
|
|
132
145
|
/** Get days of week names */
|
|
133
146
|
getDayOfWeekNames(style) {
|
|
@@ -147,7 +160,7 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
147
160
|
}
|
|
148
161
|
/** Get week name */
|
|
149
162
|
getWeekName(date) {
|
|
150
|
-
return date.week().toLocaleString(this.locale);
|
|
163
|
+
return date.week().toLocaleString(this.locale());
|
|
151
164
|
}
|
|
152
165
|
/** Get hour names */
|
|
153
166
|
getHourNames({ meridian, twoDigit }) {
|
|
@@ -191,13 +204,22 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
191
204
|
/** Try to parse a string to a date object */
|
|
192
205
|
parse(value, parseFormat = '') {
|
|
193
206
|
if (value && typeof value === 'string') {
|
|
194
|
-
return this._createDayjsDate(value, parseFormat);
|
|
207
|
+
return this._createDayjsDate(value, parseFormat).locale(this.locale());
|
|
195
208
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
209
|
+
// If value is a non-Date object with a toString() method (e.g. FdDate),
|
|
210
|
+
// convert to string first to avoid misinterpretation by dayjs objectSupport plugin
|
|
211
|
+
// (which uses 0-based months and 'date' instead of 'day').
|
|
212
|
+
if (value &&
|
|
213
|
+
typeof value === 'object' &&
|
|
214
|
+
!(value instanceof Date) &&
|
|
215
|
+
!dayjs.isDayjs(value) &&
|
|
216
|
+
typeof value.toString === 'function') {
|
|
217
|
+
const str = value.toString();
|
|
218
|
+
if (str && str !== '[object Object]') {
|
|
219
|
+
return this._createDayjsDate(str, parseFormat || undefined).locale(this.locale());
|
|
220
|
+
}
|
|
199
221
|
}
|
|
200
|
-
return value ? this._createDayjsDate(value).locale(this.locale) : null;
|
|
222
|
+
return value ? this._createDayjsDate(value).locale(this.locale()) : null;
|
|
201
223
|
}
|
|
202
224
|
/** Format a date as a string */
|
|
203
225
|
format(date, displayFormat) {
|
|
@@ -205,13 +227,24 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
205
227
|
return '';
|
|
206
228
|
}
|
|
207
229
|
if (!this.isValid(date)) {
|
|
208
|
-
throw Error('
|
|
230
|
+
throw Error('DayjsDatetimeAdapter: Cannot format invalid date.');
|
|
209
231
|
}
|
|
210
|
-
return date.locale(
|
|
232
|
+
return date.locale(this.locale()).format(displayFormat);
|
|
211
233
|
}
|
|
212
234
|
/** Create date object from values */
|
|
213
235
|
createDate(year, month, date) {
|
|
214
|
-
const
|
|
236
|
+
const { useUtc } = this._options || {};
|
|
237
|
+
let result;
|
|
238
|
+
if (typeof month === 'number' && typeof date === 'number') {
|
|
239
|
+
// Build date from components. Use string format to avoid timezone shift
|
|
240
|
+
// when useUtc is true (passing native Date to dayjs.utc() reads UTC millis,
|
|
241
|
+
// which differs from local midnight by the timezone offset).
|
|
242
|
+
const dateStr = `${year}-${String(month).padStart(2, '0')}-${String(date).padStart(2, '0')}`;
|
|
243
|
+
result = useUtc ? dayjs.utc(dateStr, 'YYYY-MM-DD', true) : dayjs(new Date(year, month - 1, date));
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
result = this._createDayjsDate(`${year}`);
|
|
247
|
+
}
|
|
215
248
|
if (!result.isValid()) {
|
|
216
249
|
throw Error(`Invalid date "${date}" for month with index "${month}" and year "${year}".`);
|
|
217
250
|
}
|
|
@@ -219,11 +252,11 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
219
252
|
}
|
|
220
253
|
/** Get today */
|
|
221
254
|
today() {
|
|
222
|
-
return this._createDayjsDate().locale(this.locale).startOf('day');
|
|
255
|
+
return this._createDayjsDate().locale(this.locale()).startOf('day');
|
|
223
256
|
}
|
|
224
257
|
/** Get now */
|
|
225
258
|
now() {
|
|
226
|
-
return this._createDayjsDate().locale(this.locale);
|
|
259
|
+
return this._createDayjsDate().locale(this.locale());
|
|
227
260
|
}
|
|
228
261
|
/** Add years to date */
|
|
229
262
|
addCalendarYears(date, years) {
|
|
@@ -240,10 +273,10 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
240
273
|
/** Clone date */
|
|
241
274
|
clone(date) {
|
|
242
275
|
if (!date) {
|
|
243
|
-
|
|
276
|
+
throw new Error('DayjsDatetimeAdapter: Cannot clone a null/undefined date.');
|
|
244
277
|
}
|
|
245
|
-
if (this.locale) {
|
|
246
|
-
return date.clone().locale(this.locale);
|
|
278
|
+
if (this.locale()) {
|
|
279
|
+
return date.clone().locale(this.locale());
|
|
247
280
|
}
|
|
248
281
|
return date.clone();
|
|
249
282
|
}
|
|
@@ -273,9 +306,9 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
273
306
|
isValid(date) {
|
|
274
307
|
return !!date?.isValid();
|
|
275
308
|
}
|
|
276
|
-
/**
|
|
309
|
+
/** {@inheritDoc DatetimeAdapter.toIso8601} */
|
|
277
310
|
toIso8601(date) {
|
|
278
|
-
return date.
|
|
311
|
+
return date.format('YYYY-MM-DDTHH:mm:ss');
|
|
279
312
|
}
|
|
280
313
|
/** Check if time format includes day period */
|
|
281
314
|
isTimeFormatIncludesDayPeriod(displayFormat) {
|
|
@@ -304,7 +337,7 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
304
337
|
_prepareFormat(displayFormat) {
|
|
305
338
|
displayFormat = displayFormat.trim();
|
|
306
339
|
try {
|
|
307
|
-
const formats = dayjs.Ls[
|
|
340
|
+
const formats = dayjs.Ls[this.locale()].formats;
|
|
308
341
|
// this is the regular expression to parse format taken from dayjs repo
|
|
309
342
|
// https://github.com/iamkun/dayjs/blob/dev/src/plugin/localizedFormat/utils.js
|
|
310
343
|
return displayFormat.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (_, a, b) => a || formats[b] || displayFormat);
|
|
@@ -314,58 +347,94 @@ class DayjsDatetimeAdapter extends DatetimeAdapter {
|
|
|
314
347
|
}
|
|
315
348
|
}
|
|
316
349
|
/** @hidden */
|
|
317
|
-
_createDayjsDate(date, format
|
|
350
|
+
_createDayjsDate(date, format) {
|
|
318
351
|
const { strict, useUtc } = this._options || {};
|
|
319
|
-
const method = useUtc
|
|
352
|
+
const method = useUtc ? dayjs.utc : dayjs;
|
|
320
353
|
if (typeof date === 'string' && format) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
'
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
354
|
+
// Expand localized format tokens (e.g. 'L', 'LT') using the instance
|
|
355
|
+
// locale so that parsing does not depend on the global dayjs locale.
|
|
356
|
+
const expandedFormat = this._prepareFormat(format);
|
|
357
|
+
// Normalize 12h patterns (h:mm A, hh:mm A, h:mm a, etc.) to 24h (HH:mm).
|
|
358
|
+
// Also strip stray AM/PM marker from already-uppercase HH patterns (HH:mm A → HH:mm).
|
|
359
|
+
// This handles inputs where convertToDesiredFormat already stripped AM/PM
|
|
360
|
+
// and converted to 24h before parse() was called (e.g. '14:30' against 'h:mm A').
|
|
361
|
+
const normalized24h = expandedFormat
|
|
362
|
+
.replace(/h{1,2}(:mm(?::ss)?) ?[aA]/g, 'HH$1') // lowercase h → HH
|
|
363
|
+
.replace(/(HH?)(:mm(?::ss)?) ?[aA]/g, 'HH$2'); // uppercase HH + stray A → HH
|
|
364
|
+
const rawFormats = [
|
|
365
|
+
expandedFormat, // original (expanded)
|
|
366
|
+
normalized24h, // 24h variant for inputs where AM/PM was pre-stripped
|
|
367
|
+
expandedFormat.replace(/ ?[Hh]{1,2}:?mm(?::?ss)?(?: ?[aA])?/, '').trim(), // remove time
|
|
368
|
+
dayjs.Ls[this.locale()]?.formats?.['L'],
|
|
369
|
+
'YYYY-MM-DD'
|
|
370
|
+
].filter((f) => !!f);
|
|
371
|
+
// Deduplicate to avoid trying the same format twice
|
|
372
|
+
const fallbackFormats = [...new Set(rawFormats)];
|
|
337
373
|
for (const f of fallbackFormats) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
374
|
+
// Try strict first to reject overflow values (month 13, day 45, etc.)
|
|
375
|
+
const strictParsed = method(date, f, true);
|
|
376
|
+
if (strictParsed.isValid()) {
|
|
377
|
+
return strictParsed;
|
|
378
|
+
}
|
|
379
|
+
// If strict fails and global strict is disabled, try non-strict
|
|
380
|
+
// to handle separator differences (e.g. '/' vs '.')
|
|
381
|
+
if (!strict) {
|
|
382
|
+
const looseParsed = method(date, f, false);
|
|
383
|
+
if (looseParsed.isValid() && this._hasNoOverflow(date, looseParsed, f)) {
|
|
384
|
+
return looseParsed;
|
|
385
|
+
}
|
|
341
386
|
}
|
|
342
387
|
}
|
|
388
|
+
// No format matched — return an invalid date
|
|
389
|
+
return method(null);
|
|
343
390
|
}
|
|
344
391
|
const parsed = method(date, format, strict);
|
|
345
392
|
return parsed;
|
|
346
393
|
}
|
|
347
|
-
|
|
394
|
+
/**
|
|
395
|
+
* @hidden
|
|
396
|
+
* Checks that non-strict parsing didn't wrap overflow values.
|
|
397
|
+
* Re-formats the parsed date with the same format and compares numeric segments
|
|
398
|
+
* positionally against the input. This catches cases like '2026-13-45' being
|
|
399
|
+
* silently wrapped to '2027-02-14'.
|
|
400
|
+
* Skipped for time-only formats that don't include date components.
|
|
401
|
+
*/
|
|
402
|
+
_hasNoOverflow(input, parsed, format) {
|
|
403
|
+
// Expand localized format tokens (e.g. 'L' → 'MM/DD/YYYY') before checking
|
|
404
|
+
const expandedFormat = this._prepareFormat(format);
|
|
405
|
+
// If the format is time-only (no date components), check time overflow too
|
|
406
|
+
if (!expandedFormat.match(/[YMDd]/)) {
|
|
407
|
+
const timeReformatted = parsed.format(expandedFormat);
|
|
408
|
+
const timeInputNums = input.match(/\d+/g) ?? [];
|
|
409
|
+
const timeOutputNums = timeReformatted.match(/\d+/g) ?? [];
|
|
410
|
+
// If format includes meridiem, hour can legitimately differ (10 PM → 22).
|
|
411
|
+
// Only compare minute/second segments (skip first digit = hour).
|
|
412
|
+
if (expandedFormat.match(/[aA]/)) {
|
|
413
|
+
return (timeInputNums.length === timeOutputNums.length &&
|
|
414
|
+
timeInputNums.slice(1).every((n, i) => n === timeOutputNums[i + 1]));
|
|
415
|
+
}
|
|
416
|
+
// Otherwise compare all numeric segments positionally
|
|
417
|
+
return (timeInputNums.length === timeOutputNums.length && timeInputNums.every((n, i) => n === timeOutputNums[i]));
|
|
418
|
+
}
|
|
419
|
+
// Re-format the parsed date and compare numeric segments positionally
|
|
420
|
+
const reformatted = parsed.format(expandedFormat);
|
|
421
|
+
const inputNums = input.match(/\d+/g) ?? [];
|
|
422
|
+
const outputNums = reformatted.match(/\d+/g) ?? [];
|
|
423
|
+
// Compare each numeric segment — if any differ, the parse wrapped an overflow
|
|
424
|
+
return inputNums.length === outputNums.length && inputNums.every((n, i) => n === outputNums[i]);
|
|
425
|
+
}
|
|
426
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
348
427
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapter }); }
|
|
349
428
|
}
|
|
350
429
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapter, decorators: [{
|
|
351
430
|
type: Injectable
|
|
352
|
-
}], ctorParameters: () => [
|
|
353
|
-
type: Optional
|
|
354
|
-
}, {
|
|
355
|
-
type: Inject,
|
|
356
|
-
args: [LOCALE_ID]
|
|
357
|
-
}] }, { type: undefined, decorators: [{
|
|
358
|
-
type: Optional
|
|
359
|
-
}, {
|
|
360
|
-
type: Inject,
|
|
361
|
-
args: [DAYJS_DATE_TIME_ADAPTER_OPTIONS]
|
|
362
|
-
}] }] });
|
|
431
|
+
}], ctorParameters: () => [] });
|
|
363
432
|
|
|
364
433
|
const DAYJS_DATETIME_FORMATS = {
|
|
365
434
|
parse: {
|
|
366
435
|
dateInput: 'L',
|
|
367
|
-
timeInput: 'h:mm',
|
|
368
|
-
dateTimeInput: 'L h:mm'
|
|
436
|
+
timeInput: 'h:mm A',
|
|
437
|
+
dateTimeInput: 'L h:mm A'
|
|
369
438
|
},
|
|
370
439
|
display: {
|
|
371
440
|
dateInput: 'L',
|
|
@@ -396,30 +465,41 @@ const DAYJS_DATETIME_FORMATS_24H = {
|
|
|
396
465
|
};
|
|
397
466
|
|
|
398
467
|
/**
|
|
399
|
-
*
|
|
400
|
-
*
|
|
468
|
+
* Returns environment providers that register `DayjsDatetimeAdapter` and the
|
|
469
|
+
* default dayjs date-time formats.
|
|
470
|
+
*
|
|
471
|
+
* Use this in `bootstrapApplication` or route providers instead of importing the module:
|
|
472
|
+
* ```ts
|
|
473
|
+
* bootstrapApplication(AppComponent, {
|
|
474
|
+
* providers: [provideDayjsDatetimeAdapter()]
|
|
475
|
+
* });
|
|
476
|
+
* ```
|
|
401
477
|
*/
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
478
|
+
function provideDayjsDatetimeAdapter() {
|
|
479
|
+
return makeEnvironmentProviders([
|
|
480
|
+
{ provide: DatetimeAdapter, useClass: DayjsDatetimeAdapter },
|
|
481
|
+
{ provide: DATE_TIME_FORMATS, useValue: DAYJS_DATETIME_FORMATS }
|
|
482
|
+
]);
|
|
406
483
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}]
|
|
412
|
-
}] });
|
|
484
|
+
/**
|
|
485
|
+
* @deprecated Use `provideDayjsDatetimeAdapter()` instead.
|
|
486
|
+
* Kept for backwards compatibility. Will be removed in a future major version.
|
|
487
|
+
*/
|
|
413
488
|
class DayjsDatetimeAdapterModule {
|
|
414
489
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
415
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapterModule
|
|
416
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapterModule, providers: [
|
|
490
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapterModule }); }
|
|
491
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapterModule, providers: [
|
|
492
|
+
{ provide: DatetimeAdapter, useClass: DayjsDatetimeAdapter },
|
|
493
|
+
{ provide: DATE_TIME_FORMATS, useValue: DAYJS_DATETIME_FORMATS }
|
|
494
|
+
] }); }
|
|
417
495
|
}
|
|
418
496
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DayjsDatetimeAdapterModule, decorators: [{
|
|
419
497
|
type: NgModule,
|
|
420
498
|
args: [{
|
|
421
|
-
|
|
422
|
-
|
|
499
|
+
providers: [
|
|
500
|
+
{ provide: DatetimeAdapter, useClass: DayjsDatetimeAdapter },
|
|
501
|
+
{ provide: DATE_TIME_FORMATS, useValue: DAYJS_DATETIME_FORMATS }
|
|
502
|
+
]
|
|
423
503
|
}]
|
|
424
504
|
}] });
|
|
425
505
|
|
|
@@ -427,5 +507,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
427
507
|
* Generated bundle index. Do not edit.
|
|
428
508
|
*/
|
|
429
509
|
|
|
430
|
-
export { DAYJS_DATETIME_FORMATS, DAYJS_DATETIME_FORMATS_24H, DAYJS_DATE_TIME_ADAPTER_OPTIONS, DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY, DayjsDatetimeAdapter, DayjsDatetimeAdapterModule,
|
|
510
|
+
export { DAYJS_DATETIME_FORMATS, DAYJS_DATETIME_FORMATS_24H, DAYJS_DATE_TIME_ADAPTER_OPTIONS, DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY, DayjsDatetimeAdapter, DayjsDatetimeAdapterModule, provideDayjsDatetimeAdapter };
|
|
431
511
|
//# sourceMappingURL=fundamental-ngx-datetime-adapter.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-datetime-adapter.mjs","sources":["../../../../libs/datetime-adapter/src/lib/dayjs-datetime-adapter.ts","../../../../libs/datetime-adapter/src/lib/dayjs-datetime-formats.ts","../../../../libs/datetime-adapter/src/lib/dayjs-datetime-adapter.module.ts","../../../../libs/datetime-adapter/src/fundamental-ngx-datetime-adapter.ts"],"sourcesContent":["import { Inject, Injectable, InjectionToken, LOCALE_ID, Optional } from '@angular/core';\nimport dayjs, { ConfigType, Dayjs } from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport isBetween from 'dayjs/plugin/isBetween';\nimport localeData from 'dayjs/plugin/localeData';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport objectSupport from 'dayjs/plugin/objectSupport';\nimport utc from 'dayjs/plugin/utc';\nimport weekOfYear from 'dayjs/plugin/weekOfYear';\n\nimport { Nullable } from '@fundamental-ngx/cdk/utils';\nimport { DatetimeAdapter, FdDate } from '@fundamental-ngx/core/datetime';\n\nfunction range<T>(length: number, mapFn: (index: number) => T): T[] {\n return Array.from(new Array(length)).map((_, index) => mapFn(index));\n}\n\nexport interface DayjsDatetimeAdapterOptions {\n strict?: boolean;\n useUtc?: boolean;\n}\n\nexport const DAYJS_DATE_TIME_ADAPTER_OPTIONS = new InjectionToken<DayjsDatetimeAdapterOptions>(\n 'DAYJS_DATE_TIME_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @hidden */\nexport function DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY(): DayjsDatetimeAdapterOptions {\n return {\n useUtc: false,\n strict: false\n };\n}\n\n/**\n * DatetimeAdapter implementation based on dayjs.\n *\n * This uses dayjs as a date model instance.\n * It relies on dayjs implementation for formatting and translation purposes.\n */\n@Injectable()\nexport class DayjsDatetimeAdapter extends DatetimeAdapter<Dayjs> {\n /** @hidden */\n private _dayjsLocaleData: dayjs.GlobalLocaleDataReturn;\n\n /** @hidden */\n private _localeData: DateLocale;\n\n /** @hidden */\n constructor(\n @Optional() @Inject(LOCALE_ID) localeId: string,\n @Optional() @Inject(DAYJS_DATE_TIME_ADAPTER_OPTIONS) private _options?: DayjsDatetimeAdapterOptions\n ) {\n super();\n\n dayjs.extend(localeData);\n dayjs.extend(weekOfYear);\n dayjs.extend(utc);\n dayjs.extend(isBetween);\n dayjs.extend(objectSupport);\n dayjs.extend(localizedFormat);\n dayjs.extend(customParseFormat);\n\n this.setLocale(localeId || dayjs.locale());\n }\n\n /** @hiden */\n fromNow?(date: dayjs.Dayjs): string;\n\n /** Set locale */\n setLocale(locale: string): void {\n if (locale.toLowerCase() === 'en-us') {\n // Handle English locale name as it's a default one and it is different\n locale = 'en';\n }\n dayjs.locale(locale);\n\n if (dayjs.locale() !== locale) {\n throw new Error(\n `Failed to load locale ${locale}. ` +\n 'Make sure it exists and is preloaded. See the imports at the top of the example file at ' +\n 'https://sap.github.io/fundamental-ngx/#/core/dayjs-datetime-adapter' +\n 'List of supported locales can be found here: https://github.com/iamkun/dayjs/tree/dev/src/locale.'\n );\n }\n\n this._dayjsLocaleData = dayjs.localeData();\n\n this._localeData = {\n firstDayOfWeek: this._dayjsLocaleData.firstDayOfWeek(),\n longMonths: this._dayjsLocaleData.months(),\n shortMonths: this._dayjsLocaleData.monthsShort(),\n narrowMonths: this._dayjsLocaleData.months().map((name: string) => name.charAt(0)),\n longDaysOfWeek: this._dayjsLocaleData.weekdays(),\n shortDaysOfWeek: this._dayjsLocaleData.weekdaysShort(),\n narrowDaysOfWeek: this._dayjsLocaleData.weekdaysMin()\n };\n\n super.setLocale(locale);\n }\n\n /** Get year */\n getYear(date: Dayjs): number {\n return date.year();\n }\n\n /** Get month */\n getMonth(date: Dayjs): number {\n return date.month() + 1;\n }\n\n /** Get date */\n getDate(date: Dayjs): number {\n return date.date();\n }\n\n /** Get day of the week */\n getDayOfWeek(date: Dayjs): number {\n return date.day() + 1;\n }\n\n /** Get hours */\n getHours(date: Dayjs): number {\n return date.hour();\n }\n\n /** Get minutes */\n getMinutes(date: Dayjs): number {\n return date.minute();\n }\n\n /** Get seconds */\n getSeconds(date: Dayjs): number {\n return date.second();\n }\n\n /** Set hours in date object */\n setHours(date: Dayjs, hours: number): Dayjs {\n return date.hour(hours);\n }\n\n /** Set minutes in date object */\n setMinutes(date: Dayjs, minutes: number): Dayjs {\n return date.minute(minutes);\n }\n\n /** Set seconds in date object */\n setSeconds(date: Dayjs, seconds: number): Dayjs {\n return date.second(seconds);\n }\n\n /** Get week number */\n getWeekNumber(date: Dayjs): number {\n return date.week();\n }\n\n /** Get months names */\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n switch (style) {\n case 'narrow':\n return this._localeData.narrowMonths;\n case 'short':\n return this._localeData.shortMonths;\n case 'long':\n default:\n return this._localeData.longMonths;\n }\n }\n\n /** Get date names */\n getDateNames(): string[] {\n return range(31, (i) => this.createDate(2017, 0, i + 1).format('D'));\n }\n\n /** Get days of week names */\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n switch (style) {\n case 'narrow':\n return this._localeData.narrowDaysOfWeek;\n case 'short':\n return this._localeData.shortDaysOfWeek;\n case 'long':\n default:\n return this._localeData.longDaysOfWeek;\n }\n }\n\n /** Get year name */\n getYearName(date: Dayjs): string {\n return date.format('YYYY');\n }\n\n /** Get week name */\n getWeekName(date: Dayjs): string {\n return date.week().toLocaleString(this.locale);\n }\n\n /** Get hour names */\n getHourNames({ meridian, twoDigit }: { twoDigit: boolean; meridian: boolean }): string[] {\n const format: string = meridian ? (twoDigit ? 'hh' : 'h') : twoDigit ? 'HH' : 'H';\n const dayjsDate = this._createDayjsDate();\n\n return range(24, (i) => this.clone(dayjsDate).hour(i).format(format));\n }\n\n /** Get minute names */\n getMinuteNames({ twoDigit, minuteStep = 1 }: { twoDigit: boolean; minuteStep?: number }): string[] {\n const format: string = twoDigit ? 'mm' : 'm';\n const dayjsDate = this._createDayjsDate();\n const length = Math.ceil(60 / minuteStep);\n\n return range(length, (index) => {\n const minute = index * minuteStep;\n return this.clone(dayjsDate).minute(minute).format(format);\n });\n }\n\n /** Get second names */\n getSecondNames({ twoDigit }: { twoDigit: boolean }): string[] {\n const format: string = twoDigit ? 'ss' : 's';\n const dayjsDate = this._createDayjsDate();\n\n return range(60, (i) => this.clone(dayjsDate).second(i).format(format));\n }\n\n /**\n * Get day period names\n * @param isLower responsible for the lower and upper cases of the result\n */\n getDayPeriodNames(isLower = false): [string, string] {\n const AM = this._dayjsLocaleData.meridiem?.(6, 0, isLower) ?? (isLower ? 'am' : 'AM');\n const PM = this._dayjsLocaleData.meridiem?.(16, 0, isLower) ?? (isLower ? 'pm' : 'PM');\n\n return [AM, PM];\n }\n\n /** Get first day of the week */\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n /** Get number of days in the month */\n getNumDaysInMonth(date: Dayjs): number {\n return date.daysInMonth();\n }\n\n /** Try to parse a string to a date object */\n parse(value: any, parseFormat: string = ''): Dayjs | null {\n if (value && typeof value === 'string') {\n return this._createDayjsDate(value, parseFormat);\n } else if (value instanceof FdDate) {\n // FdDate instance may be incorrectly parsed by DayJS\n value = value.toString();\n }\n\n return value ? this._createDayjsDate(value).locale(this.locale) : null;\n }\n\n /** Format a date as a string */\n format(date: Dayjs, displayFormat: string): string {\n if (!date) {\n return '';\n }\n\n if (!this.isValid(date)) {\n throw Error('DayjsDateTimeAdapter: Cannot format invalid date.');\n }\n\n return date.locale(dayjs.locale()).format(displayFormat);\n }\n\n /** Create date object from values */\n createDate(year: number, month?: number, date?: number): Dayjs {\n const result = this._createDayjsDate(\n typeof month === 'number' && typeof date === 'number' ? new Date(year, month - 1, date) : `${year}`,\n undefined,\n true\n );\n\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\" and year \"${year}\".`);\n }\n\n return result;\n }\n\n /** Get today */\n today(): Dayjs {\n return this._createDayjsDate().locale(this.locale).startOf('day');\n }\n\n /** Get now */\n now(): Dayjs {\n return this._createDayjsDate().locale(this.locale);\n }\n\n /** Add years to date */\n addCalendarYears(date: Dayjs, years: number): Dayjs {\n return date.add(years, 'year');\n }\n\n /** Add months to date */\n addCalendarMonths(date: Dayjs, months: number): Dayjs {\n return date.add(months, 'month');\n }\n\n /** Add days to date */\n addCalendarDays(date: Dayjs, days: number): Dayjs {\n return date.add(days, 'day');\n }\n\n /** Clone date */\n clone(date: Dayjs): Dayjs {\n if (!date) {\n return date;\n }\n\n if (this.locale) {\n return date.clone().locale(this.locale);\n }\n\n return date.clone();\n }\n\n /** Compare if dates are equal */\n datesEqual(date1: Dayjs, date2: Dayjs): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n // Since date may come from `createDate` method which uses `local` time, we need to convert both dates to the same timezone.\n return date1.local().isSame(date2.local(), 'day');\n }\n\n /** Compare if dates and time are equal */\n dateTimesEqual(date1: Dayjs, date2: Dayjs): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n return date1.isSame(date2);\n }\n\n /** Check if date is in range */\n isBetween(dateToCheck: Dayjs, startDate: Dayjs, endDate: Dayjs): boolean {\n if (!dateToCheck || !startDate || !endDate) {\n return false;\n }\n\n return dateToCheck.isBetween(startDate, endDate);\n }\n\n /** Check if date is valid date object */\n isValid(date: Nullable<Dayjs>): date is Dayjs {\n return !!date?.isValid();\n }\n\n /** Convert date to ISO8601 string */\n toIso8601(date: Dayjs): string {\n return date.toISOString();\n }\n\n /** Check if time format includes day period */\n isTimeFormatIncludesDayPeriod(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[aA]/);\n }\n\n /** Check if time format includes hours */\n isTimeFormatIncludesHours(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[hH]/);\n }\n\n /** Check if time format includes minutes */\n isTimeFormatIncludesMinutes(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[m]/);\n }\n\n /** Check if time format includes seconds */\n isTimeFormatIncludesSeconds(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[s]/);\n }\n\n /**\n * @hidden\n * will attempt to parse longDataFormat (e.g. \"L\", \"LT\") and convert it to simple one.\n */\n _prepareFormat(displayFormat: string): string {\n displayFormat = displayFormat.trim();\n try {\n const formats: object = dayjs.Ls[dayjs.locale()].formats;\n // this is the regular expression to parse format taken from dayjs repo\n // https://github.com/iamkun/dayjs/blob/dev/src/plugin/localizedFormat/utils.js\n return displayFormat.replace(\n /(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => a || formats[b] || displayFormat\n );\n } catch {\n return displayFormat;\n }\n }\n\n /** @hidden */\n _createDayjsDate(date?: ConfigType, format?: string, ignoreUtc = false): Dayjs {\n const { strict, useUtc }: DayjsDatetimeAdapterOptions = this._options || {};\n const method = useUtc && !ignoreUtc ? dayjs.utc : dayjs;\n\n if (typeof date === 'string' && format) {\n const fallbackFormats = [\n format, // original\n format.replace(/ ?[Hh]:?mm[aA]?/, ''), // remove time\n format.replace(/ ?[Hh]:?mm/, ''), // remove time (no meridiem),\n format.replace(/h:mm ?[aA]/, 'HH:mm'),\n format.replace(/h:mm ?[aA]/, 'H:mm'),\n format.replace(/HH:mm ?[aA]/, 'HH:mm'),\n format.replace(/H:mm ?[aA]/, 'H:mm'),\n 'L',\n dayjs.Ls[dayjs.locale()].formats['L'],\n 'DD/MM/YYYY',\n // Only fall back to ISO format when the string actually starts with a 4-digit year,\n // otherwise a US-locale string like \"5/25/2025 15:30\" gets mis-parsed as a valid\n // ISO date with the wrong year and hour=0 (the original bug).\n ...(typeof date === 'string' && /^\\d{4}-/.test(date) ? ['YYYY-MM-DD'] : [])\n ];\n\n for (const f of fallbackFormats) {\n const tryParsed = method(date, f, strict);\n if (tryParsed.isValid()) {\n return tryParsed;\n }\n }\n }\n\n const parsed = method(date, format, strict);\n return parsed;\n }\n}\n\ninterface DateLocale {\n firstDayOfWeek: number;\n longMonths: string[];\n shortMonths: string[];\n narrowMonths: string[];\n longDaysOfWeek: string[];\n shortDaysOfWeek: string[];\n narrowDaysOfWeek: string[];\n}\n","import { DateTimeFormats } from '@fundamental-ngx/core/datetime';\n\nexport const DAYJS_DATETIME_FORMATS: DateTimeFormats = {\n parse: {\n dateInput: 'L',\n timeInput: 'h:mm',\n dateTimeInput: 'L h:mm'\n },\n display: {\n dateInput: 'L',\n timeInput: 'h:mm A',\n dateTimeInput: 'L h:mm A',\n\n dateA11yLabel: 'YYYY MMMM DD',\n monthA11yLabel: 'MMMM',\n yearA11yLabel: 'YYYY'\n },\n rangeDelimiter: ' - '\n};\n\n/** Preset for applications that display and accept 24-hour time input. */\nexport const DAYJS_DATETIME_FORMATS_24H: DateTimeFormats = {\n parse: {\n dateInput: 'L',\n timeInput: 'H:mm',\n dateTimeInput: 'L H:mm'\n },\n display: {\n dateInput: 'L',\n timeInput: 'HH:mm',\n dateTimeInput: 'L HH:mm',\n\n dateA11yLabel: 'YYYY MMMM DD',\n monthA11yLabel: 'MMMM',\n yearA11yLabel: 'YYYY'\n },\n rangeDelimiter: ' - '\n};\n","import { NgModule } from '@angular/core';\nimport { DATE_TIME_FORMATS, DatetimeAdapter } from '@fundamental-ngx/core/datetime';\n\nimport { DayjsDatetimeAdapter } from './dayjs-datetime-adapter';\nimport { DAYJS_DATETIME_FORMATS } from './dayjs-datetime-formats';\n\n/**\n * @deprecated\n * Use direct imports of components and directives.\n */\n@NgModule({\n providers: [{ provide: DatetimeAdapter, useClass: DayjsDatetimeAdapter }]\n})\nexport class DayjsDatetimeAdapterRawModule {}\n\n@NgModule({\n imports: [DayjsDatetimeAdapterRawModule],\n providers: [{ provide: DATE_TIME_FORMATS, useValue: DAYJS_DATETIME_FORMATS }]\n})\nexport class DayjsDatetimeAdapterModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAaA,SAAS,KAAK,CAAI,MAAc,EAAE,KAA2B,EAAA;IACzD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,KAAK,CAAC,KAAK,CAAC,CAAC;AACxE;MAOa,+BAA+B,G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version":3,"file":"fundamental-ngx-datetime-adapter.mjs","sources":["../../../../libs/datetime-adapter/src/lib/dayjs-datetime-adapter.ts","../../../../libs/datetime-adapter/src/lib/dayjs-datetime-formats.ts","../../../../libs/datetime-adapter/src/lib/dayjs-datetime-adapter.module.ts","../../../../libs/datetime-adapter/src/fundamental-ngx-datetime-adapter.ts"],"sourcesContent":["import { inject, Injectable, InjectionToken, LOCALE_ID } from '@angular/core';\nimport dayjs, { ConfigType, Dayjs } from 'dayjs';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport isBetween from 'dayjs/plugin/isBetween';\nimport localeData from 'dayjs/plugin/localeData';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport objectSupport from 'dayjs/plugin/objectSupport';\nimport relativeTime from 'dayjs/plugin/relativeTime';\nimport utc from 'dayjs/plugin/utc';\nimport weekOfYear from 'dayjs/plugin/weekOfYear';\n\nimport { Nullable } from '@fundamental-ngx/cdk/utils';\nimport { DatetimeAdapter } from '@fundamental-ngx/core/datetime';\n\n// Load plugins once at module level instead of per-instance in the constructor\ndayjs.extend(localeData);\ndayjs.extend(weekOfYear);\ndayjs.extend(utc);\ndayjs.extend(isBetween);\ndayjs.extend(objectSupport);\ndayjs.extend(localizedFormat);\ndayjs.extend(customParseFormat);\ndayjs.extend(relativeTime);\n\nfunction range<T>(length: number, mapFn: (index: number) => T): T[] {\n return Array.from(new Array(length)).map((_, index) => mapFn(index));\n}\n\nexport interface DayjsDatetimeAdapterOptions {\n strict?: boolean;\n useUtc?: boolean;\n}\n\nexport const DAYJS_DATE_TIME_ADAPTER_OPTIONS = new InjectionToken<DayjsDatetimeAdapterOptions>(\n 'DAYJS_DATE_TIME_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @hidden */\nexport function DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY(): DayjsDatetimeAdapterOptions {\n return {\n useUtc: false,\n strict: false\n };\n}\n\n/**\n * DatetimeAdapter implementation based on dayjs.\n *\n * This uses dayjs as a date model instance.\n * It relies on dayjs implementation for formatting and translation purposes.\n */\n@Injectable()\nexport class DayjsDatetimeAdapter extends DatetimeAdapter<Dayjs> {\n /** @hidden */\n private _dayjsLocaleData: dayjs.GlobalLocaleDataReturn;\n\n /** @hidden */\n private _localeData: DateLocale;\n\n /** @hidden */\n private readonly _options = inject(DAYJS_DATE_TIME_ADAPTER_OPTIONS, { optional: true });\n\n /** @hidden */\n constructor() {\n super();\n\n const localeId = inject(LOCALE_ID, { optional: true });\n this.setLocale(localeId || dayjs.locale());\n }\n\n /** @hidden */\n fromNow(date: Dayjs): string {\n return date.locale(this.locale()).fromNow();\n }\n\n /** Set locale */\n setLocale(locale: string): void {\n if (locale.toLowerCase() === 'en-us') {\n // Handle English locale name as it's a default one and it is different\n locale = 'en';\n }\n\n if (!dayjs.Ls[locale]) {\n console.warn(\n `Failed to load locale ${locale}. Falling back to 'en'. ` +\n 'Make sure it exists and is preloaded. See the imports at the top of the example file at ' +\n 'https://sap.github.io/fundamental-ngx/#/core/dayjs-datetime-adapter ' +\n 'List of supported locales can be found here: https://github.com/iamkun/dayjs/tree/dev/src/locale.'\n );\n locale = 'en';\n }\n\n // Use a temporary instance to read locale data without mutating global dayjs state.\n this._dayjsLocaleData = dayjs().locale(locale).localeData();\n\n this._localeData = {\n firstDayOfWeek: this._dayjsLocaleData.firstDayOfWeek(),\n longMonths: this._dayjsLocaleData.months(),\n shortMonths: this._dayjsLocaleData.monthsShort(),\n narrowMonths: (() => {\n const dtf = new Intl.DateTimeFormat(locale, { month: 'narrow' });\n return range(12, (i) => dtf.format(new Date(2017, i, 1)));\n })(),\n longDaysOfWeek: this._dayjsLocaleData.weekdays(),\n shortDaysOfWeek: this._dayjsLocaleData.weekdaysShort(),\n narrowDaysOfWeek: this._dayjsLocaleData.weekdaysMin()\n };\n\n super.setLocale(locale);\n }\n\n /** Get year */\n getYear(date: Dayjs): number {\n return date.year();\n }\n\n /** Get month */\n getMonth(date: Dayjs): number {\n return date.month() + 1;\n }\n\n /** Get date */\n getDate(date: Dayjs): number {\n return date.date();\n }\n\n /** Get day of the week */\n getDayOfWeek(date: Dayjs): number {\n return date.day() + 1;\n }\n\n /** Get hours */\n getHours(date: Dayjs): number {\n return date.hour();\n }\n\n /** Get minutes */\n getMinutes(date: Dayjs): number {\n return date.minute();\n }\n\n /** Get seconds */\n getSeconds(date: Dayjs): number {\n return date.second();\n }\n\n /** Set hours in date object */\n setHours(date: Dayjs, hours: number): Dayjs {\n return date.hour(hours);\n }\n\n /** Set minutes in date object */\n setMinutes(date: Dayjs, minutes: number): Dayjs {\n return date.minute(minutes);\n }\n\n /** Set seconds in date object */\n setSeconds(date: Dayjs, seconds: number): Dayjs {\n return date.second(seconds);\n }\n\n /** Get week number */\n getWeekNumber(date: Dayjs): number {\n return date.week();\n }\n\n /** Get months names */\n getMonthNames(style: 'long' | 'short' | 'narrow'): string[] {\n switch (style) {\n case 'narrow':\n return this._localeData.narrowMonths;\n case 'short':\n return this._localeData.shortMonths;\n case 'long':\n default:\n return this._localeData.longMonths;\n }\n }\n\n /** Get date names */\n getDateNames(): string[] {\n return range(31, (i) => this.createDate(2017, 1, i + 1).format('D'));\n }\n\n /** Get days of week names */\n getDayOfWeekNames(style: 'long' | 'short' | 'narrow'): string[] {\n switch (style) {\n case 'narrow':\n return this._localeData.narrowDaysOfWeek;\n case 'short':\n return this._localeData.shortDaysOfWeek;\n case 'long':\n default:\n return this._localeData.longDaysOfWeek;\n }\n }\n\n /** Get year name */\n getYearName(date: Dayjs): string {\n return date.format('YYYY');\n }\n\n /** Get week name */\n getWeekName(date: Dayjs): string {\n return date.week().toLocaleString(this.locale());\n }\n\n /** Get hour names */\n getHourNames({ meridian, twoDigit }: { twoDigit: boolean; meridian: boolean }): string[] {\n const format: string = meridian ? (twoDigit ? 'hh' : 'h') : twoDigit ? 'HH' : 'H';\n const dayjsDate = this._createDayjsDate();\n\n return range(24, (i) => this.clone(dayjsDate).hour(i).format(format));\n }\n\n /** Get minute names */\n getMinuteNames({ twoDigit, minuteStep = 1 }: { twoDigit: boolean; minuteStep?: number }): string[] {\n const format: string = twoDigit ? 'mm' : 'm';\n const dayjsDate = this._createDayjsDate();\n const length = Math.ceil(60 / minuteStep);\n\n return range(length, (index) => {\n const minute = index * minuteStep;\n return this.clone(dayjsDate).minute(minute).format(format);\n });\n }\n\n /** Get second names */\n getSecondNames({ twoDigit }: { twoDigit: boolean }): string[] {\n const format: string = twoDigit ? 'ss' : 's';\n const dayjsDate = this._createDayjsDate();\n\n return range(60, (i) => this.clone(dayjsDate).second(i).format(format));\n }\n\n /**\n * Get day period names\n * @param isLower responsible for the lower and upper cases of the result\n */\n getDayPeriodNames(isLower = false): [string, string] {\n const AM = this._dayjsLocaleData.meridiem?.(6, 0, isLower) ?? (isLower ? 'am' : 'AM');\n const PM = this._dayjsLocaleData.meridiem?.(16, 0, isLower) ?? (isLower ? 'pm' : 'PM');\n\n return [AM, PM];\n }\n\n /** Get first day of the week */\n getFirstDayOfWeek(): number {\n return this._localeData.firstDayOfWeek;\n }\n\n /** Get number of days in the month */\n getNumDaysInMonth(date: Dayjs): number {\n return date.daysInMonth();\n }\n\n /** Try to parse a string to a date object */\n parse(value: any, parseFormat: string = ''): Dayjs | null {\n if (value && typeof value === 'string') {\n return this._createDayjsDate(value, parseFormat).locale(this.locale());\n }\n\n // If value is a non-Date object with a toString() method (e.g. FdDate),\n // convert to string first to avoid misinterpretation by dayjs objectSupport plugin\n // (which uses 0-based months and 'date' instead of 'day').\n if (\n value &&\n typeof value === 'object' &&\n !(value instanceof Date) &&\n !dayjs.isDayjs(value) &&\n typeof value.toString === 'function'\n ) {\n const str = value.toString();\n if (str && str !== '[object Object]') {\n return this._createDayjsDate(str, parseFormat || undefined).locale(this.locale());\n }\n }\n\n return value ? this._createDayjsDate(value).locale(this.locale()) : null;\n }\n\n /** Format a date as a string */\n format(date: Dayjs, displayFormat: string): string {\n if (!date) {\n return '';\n }\n\n if (!this.isValid(date)) {\n throw Error('DayjsDatetimeAdapter: Cannot format invalid date.');\n }\n\n return date.locale(this.locale()).format(displayFormat);\n }\n\n /** Create date object from values */\n createDate(year: number, month?: number, date?: number): Dayjs {\n const { useUtc }: DayjsDatetimeAdapterOptions = this._options || {};\n\n let result: Dayjs;\n if (typeof month === 'number' && typeof date === 'number') {\n // Build date from components. Use string format to avoid timezone shift\n // when useUtc is true (passing native Date to dayjs.utc() reads UTC millis,\n // which differs from local midnight by the timezone offset).\n const dateStr = `${year}-${String(month).padStart(2, '0')}-${String(date).padStart(2, '0')}`;\n result = useUtc ? dayjs.utc(dateStr, 'YYYY-MM-DD', true) : dayjs(new Date(year, month - 1, date));\n } else {\n result = this._createDayjsDate(`${year}`);\n }\n\n if (!result.isValid()) {\n throw Error(`Invalid date \"${date}\" for month with index \"${month}\" and year \"${year}\".`);\n }\n\n return result;\n }\n\n /** Get today */\n today(): Dayjs {\n return this._createDayjsDate().locale(this.locale()).startOf('day');\n }\n\n /** Get now */\n now(): Dayjs {\n return this._createDayjsDate().locale(this.locale());\n }\n\n /** Add years to date */\n addCalendarYears(date: Dayjs, years: number): Dayjs {\n return date.add(years, 'year');\n }\n\n /** Add months to date */\n addCalendarMonths(date: Dayjs, months: number): Dayjs {\n return date.add(months, 'month');\n }\n\n /** Add days to date */\n addCalendarDays(date: Dayjs, days: number): Dayjs {\n return date.add(days, 'day');\n }\n\n /** Clone date */\n clone(date: Dayjs): Dayjs {\n if (!date) {\n throw new Error('DayjsDatetimeAdapter: Cannot clone a null/undefined date.');\n }\n\n if (this.locale()) {\n return date.clone().locale(this.locale());\n }\n\n return date.clone();\n }\n\n /** Compare if dates are equal */\n datesEqual(date1: Dayjs, date2: Dayjs): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n // Since date may come from `createDate` method which uses `local` time, we need to convert both dates to the same timezone.\n return date1.local().isSame(date2.local(), 'day');\n }\n\n /** Compare if dates and time are equal */\n dateTimesEqual(date1: Dayjs, date2: Dayjs): boolean {\n if (!date1 || !date2) {\n return false;\n }\n\n return date1.isSame(date2);\n }\n\n /** Check if date is in range */\n isBetween(dateToCheck: Dayjs, startDate: Dayjs, endDate: Dayjs): boolean {\n if (!dateToCheck || !startDate || !endDate) {\n return false;\n }\n\n return dateToCheck.isBetween(startDate, endDate);\n }\n\n /** Check if date is valid date object */\n isValid(date: Nullable<Dayjs>): date is Dayjs {\n return !!date?.isValid();\n }\n\n /** {@inheritDoc DatetimeAdapter.toIso8601} */\n toIso8601(date: Dayjs): string {\n return date.format('YYYY-MM-DDTHH:mm:ss');\n }\n\n /** Check if time format includes day period */\n isTimeFormatIncludesDayPeriod(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[aA]/);\n }\n\n /** Check if time format includes hours */\n isTimeFormatIncludesHours(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[hH]/);\n }\n\n /** Check if time format includes minutes */\n isTimeFormatIncludesMinutes(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[m]/);\n }\n\n /** Check if time format includes seconds */\n isTimeFormatIncludesSeconds(displayFormat: string): boolean {\n const format = this._prepareFormat(displayFormat);\n\n return !!format.match(/[s]/);\n }\n\n /**\n * @hidden\n * will attempt to parse longDataFormat (e.g. \"L\", \"LT\") and convert it to simple one.\n */\n private _prepareFormat(displayFormat: string): string {\n displayFormat = displayFormat.trim();\n try {\n const formats: object = dayjs.Ls[this.locale()].formats;\n // this is the regular expression to parse format taken from dayjs repo\n // https://github.com/iamkun/dayjs/blob/dev/src/plugin/localizedFormat/utils.js\n return displayFormat.replace(\n /(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,\n (_, a, b) => a || formats[b] || displayFormat\n );\n } catch {\n return displayFormat;\n }\n }\n\n /** @hidden */\n private _createDayjsDate(date?: ConfigType, format?: string): Dayjs {\n const { strict, useUtc }: DayjsDatetimeAdapterOptions = this._options || {};\n const method = useUtc ? dayjs.utc : dayjs;\n\n if (typeof date === 'string' && format) {\n // Expand localized format tokens (e.g. 'L', 'LT') using the instance\n // locale so that parsing does not depend on the global dayjs locale.\n const expandedFormat = this._prepareFormat(format);\n\n // Normalize 12h patterns (h:mm A, hh:mm A, h:mm a, etc.) to 24h (HH:mm).\n // Also strip stray AM/PM marker from already-uppercase HH patterns (HH:mm A → HH:mm).\n // This handles inputs where convertToDesiredFormat already stripped AM/PM\n // and converted to 24h before parse() was called (e.g. '14:30' against 'h:mm A').\n const normalized24h = expandedFormat\n .replace(/h{1,2}(:mm(?::ss)?) ?[aA]/g, 'HH$1') // lowercase h → HH\n .replace(/(HH?)(:mm(?::ss)?) ?[aA]/g, 'HH$2'); // uppercase HH + stray A → HH\n\n const rawFormats: string[] = [\n expandedFormat, // original (expanded)\n normalized24h, // 24h variant for inputs where AM/PM was pre-stripped\n expandedFormat.replace(/ ?[Hh]{1,2}:?mm(?::?ss)?(?: ?[aA])?/, '').trim(), // remove time\n dayjs.Ls[this.locale()]?.formats?.['L'],\n 'YYYY-MM-DD'\n ].filter((f): f is string => !!f);\n\n // Deduplicate to avoid trying the same format twice\n const fallbackFormats = [...new Set(rawFormats)];\n\n for (const f of fallbackFormats) {\n // Try strict first to reject overflow values (month 13, day 45, etc.)\n const strictParsed = method(date, f, true);\n if (strictParsed.isValid()) {\n return strictParsed;\n }\n // If strict fails and global strict is disabled, try non-strict\n // to handle separator differences (e.g. '/' vs '.')\n if (!strict) {\n const looseParsed = method(date, f, false);\n if (looseParsed.isValid() && this._hasNoOverflow(date, looseParsed, f)) {\n return looseParsed;\n }\n }\n }\n\n // No format matched — return an invalid date\n return method(null);\n }\n\n const parsed = method(date, format, strict);\n return parsed;\n }\n\n /**\n * @hidden\n * Checks that non-strict parsing didn't wrap overflow values.\n * Re-formats the parsed date with the same format and compares numeric segments\n * positionally against the input. This catches cases like '2026-13-45' being\n * silently wrapped to '2027-02-14'.\n * Skipped for time-only formats that don't include date components.\n */\n private _hasNoOverflow(input: string, parsed: Dayjs, format: string): boolean {\n // Expand localized format tokens (e.g. 'L' → 'MM/DD/YYYY') before checking\n const expandedFormat = this._prepareFormat(format);\n\n // If the format is time-only (no date components), check time overflow too\n if (!expandedFormat.match(/[YMDd]/)) {\n const timeReformatted = parsed.format(expandedFormat);\n const timeInputNums = input.match(/\\d+/g) ?? [];\n const timeOutputNums = timeReformatted.match(/\\d+/g) ?? [];\n\n // If format includes meridiem, hour can legitimately differ (10 PM → 22).\n // Only compare minute/second segments (skip first digit = hour).\n if (expandedFormat.match(/[aA]/)) {\n return (\n timeInputNums.length === timeOutputNums.length &&\n timeInputNums.slice(1).every((n, i) => n === timeOutputNums[i + 1])\n );\n }\n\n // Otherwise compare all numeric segments positionally\n return (\n timeInputNums.length === timeOutputNums.length && timeInputNums.every((n, i) => n === timeOutputNums[i])\n );\n }\n\n // Re-format the parsed date and compare numeric segments positionally\n const reformatted = parsed.format(expandedFormat);\n const inputNums = input.match(/\\d+/g) ?? [];\n const outputNums = reformatted.match(/\\d+/g) ?? [];\n\n // Compare each numeric segment — if any differ, the parse wrapped an overflow\n return inputNums.length === outputNums.length && inputNums.every((n, i) => n === outputNums[i]);\n }\n}\n\ninterface DateLocale {\n firstDayOfWeek: number;\n longMonths: string[];\n shortMonths: string[];\n narrowMonths: string[];\n longDaysOfWeek: string[];\n shortDaysOfWeek: string[];\n narrowDaysOfWeek: string[];\n}\n","import { DateTimeFormats } from '@fundamental-ngx/core/datetime';\n\nexport const DAYJS_DATETIME_FORMATS: DateTimeFormats = {\n parse: {\n dateInput: 'L',\n timeInput: 'h:mm A',\n dateTimeInput: 'L h:mm A'\n },\n display: {\n dateInput: 'L',\n timeInput: 'h:mm A',\n dateTimeInput: 'L h:mm A',\n\n dateA11yLabel: 'YYYY MMMM DD',\n monthA11yLabel: 'MMMM',\n yearA11yLabel: 'YYYY'\n },\n rangeDelimiter: ' - '\n};\n\n/** Preset for applications that display and accept 24-hour time input. */\nexport const DAYJS_DATETIME_FORMATS_24H: DateTimeFormats = {\n parse: {\n dateInput: 'L',\n timeInput: 'H:mm',\n dateTimeInput: 'L H:mm'\n },\n display: {\n dateInput: 'L',\n timeInput: 'HH:mm',\n dateTimeInput: 'L HH:mm',\n\n dateA11yLabel: 'YYYY MMMM DD',\n monthA11yLabel: 'MMMM',\n yearA11yLabel: 'YYYY'\n },\n rangeDelimiter: ' - '\n};\n","import { EnvironmentProviders, makeEnvironmentProviders, NgModule } from '@angular/core';\nimport { DATE_TIME_FORMATS, DatetimeAdapter } from '@fundamental-ngx/core/datetime';\n\nimport { DayjsDatetimeAdapter } from './dayjs-datetime-adapter';\nimport { DAYJS_DATETIME_FORMATS } from './dayjs-datetime-formats';\n\n/**\n * Returns environment providers that register `DayjsDatetimeAdapter` and the\n * default dayjs date-time formats.\n *\n * Use this in `bootstrapApplication` or route providers instead of importing the module:\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideDayjsDatetimeAdapter()]\n * });\n * ```\n */\nexport function provideDayjsDatetimeAdapter(): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: DatetimeAdapter, useClass: DayjsDatetimeAdapter },\n { provide: DATE_TIME_FORMATS, useValue: DAYJS_DATETIME_FORMATS }\n ]);\n}\n\n/**\n * @deprecated Use `provideDayjsDatetimeAdapter()` instead.\n * Kept for backwards compatibility. Will be removed in a future major version.\n */\n@NgModule({\n providers: [\n { provide: DatetimeAdapter, useClass: DayjsDatetimeAdapter },\n { provide: DATE_TIME_FORMATS, useValue: DAYJS_DATETIME_FORMATS }\n ]\n})\nexport class DayjsDatetimeAdapterModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAcA;AACA,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;AACxB,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;AACxB,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC;AACj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name": "@fundamental-ngx/datetime-adapter",
|
|
3
|
-
"version": "0.63.0-rc.
|
|
3
|
+
"version": "0.63.0-rc.30",
|
|
4
4
|
"description": "Datetime adapter for SAP Fundamentals, based on Day.js package",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://sap.github.io/fundamental-ngx",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "git+https://github.com/SAP/fundamental-ngx.git"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@fundamental-ngx/core": "0.63.0-rc.
|
|
12
|
+
"@fundamental-ngx/core": "0.63.0-rc.30",
|
|
13
13
|
"dayjs": "^1.11.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken } from '@angular/core';
|
|
3
|
-
import
|
|
2
|
+
import { InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { Dayjs } from 'dayjs';
|
|
4
4
|
import { Nullable } from '@fundamental-ngx/cdk/utils';
|
|
5
5
|
import { DatetimeAdapter, DateTimeFormats } from '@fundamental-ngx/core/datetime';
|
|
6
6
|
|
|
@@ -18,15 +18,16 @@ declare function DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY(): DayjsDatetimeAdapter
|
|
|
18
18
|
* It relies on dayjs implementation for formatting and translation purposes.
|
|
19
19
|
*/
|
|
20
20
|
declare class DayjsDatetimeAdapter extends DatetimeAdapter<Dayjs> {
|
|
21
|
-
private _options?;
|
|
22
21
|
/** @hidden */
|
|
23
22
|
private _dayjsLocaleData;
|
|
24
23
|
/** @hidden */
|
|
25
24
|
private _localeData;
|
|
26
25
|
/** @hidden */
|
|
27
|
-
|
|
28
|
-
/** @
|
|
29
|
-
|
|
26
|
+
private readonly _options;
|
|
27
|
+
/** @hidden */
|
|
28
|
+
constructor();
|
|
29
|
+
/** @hidden */
|
|
30
|
+
fromNow(date: Dayjs): string;
|
|
30
31
|
/** Set locale */
|
|
31
32
|
setLocale(locale: string): void;
|
|
32
33
|
/** Get year */
|
|
@@ -110,7 +111,7 @@ declare class DayjsDatetimeAdapter extends DatetimeAdapter<Dayjs> {
|
|
|
110
111
|
isBetween(dateToCheck: Dayjs, startDate: Dayjs, endDate: Dayjs): boolean;
|
|
111
112
|
/** Check if date is valid date object */
|
|
112
113
|
isValid(date: Nullable<Dayjs>): date is Dayjs;
|
|
113
|
-
/**
|
|
114
|
+
/** {@inheritDoc DatetimeAdapter.toIso8601} */
|
|
114
115
|
toIso8601(date: Dayjs): string;
|
|
115
116
|
/** Check if time format includes day period */
|
|
116
117
|
isTimeFormatIncludesDayPeriod(displayFormat: string): boolean;
|
|
@@ -124,25 +125,41 @@ declare class DayjsDatetimeAdapter extends DatetimeAdapter<Dayjs> {
|
|
|
124
125
|
* @hidden
|
|
125
126
|
* will attempt to parse longDataFormat (e.g. "L", "LT") and convert it to simple one.
|
|
126
127
|
*/
|
|
127
|
-
_prepareFormat
|
|
128
|
+
private _prepareFormat;
|
|
128
129
|
/** @hidden */
|
|
129
|
-
_createDayjsDate
|
|
130
|
-
|
|
130
|
+
private _createDayjsDate;
|
|
131
|
+
/**
|
|
132
|
+
* @hidden
|
|
133
|
+
* Checks that non-strict parsing didn't wrap overflow values.
|
|
134
|
+
* Re-formats the parsed date with the same format and compares numeric segments
|
|
135
|
+
* positionally against the input. This catches cases like '2026-13-45' being
|
|
136
|
+
* silently wrapped to '2027-02-14'.
|
|
137
|
+
* Skipped for time-only formats that don't include date components.
|
|
138
|
+
*/
|
|
139
|
+
private _hasNoOverflow;
|
|
140
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DayjsDatetimeAdapter, never>;
|
|
131
141
|
static ɵprov: i0.ɵɵInjectableDeclaration<DayjsDatetimeAdapter>;
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
145
|
+
* Returns environment providers that register `DayjsDatetimeAdapter` and the
|
|
146
|
+
* default dayjs date-time formats.
|
|
147
|
+
*
|
|
148
|
+
* Use this in `bootstrapApplication` or route providers instead of importing the module:
|
|
149
|
+
* ```ts
|
|
150
|
+
* bootstrapApplication(AppComponent, {
|
|
151
|
+
* providers: [provideDayjsDatetimeAdapter()]
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
declare function provideDayjsDatetimeAdapter(): EnvironmentProviders;
|
|
156
|
+
/**
|
|
157
|
+
* @deprecated Use `provideDayjsDatetimeAdapter()` instead.
|
|
158
|
+
* Kept for backwards compatibility. Will be removed in a future major version.
|
|
137
159
|
*/
|
|
138
|
-
declare class DayjsDatetimeAdapterRawModule {
|
|
139
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DayjsDatetimeAdapterRawModule, never>;
|
|
140
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DayjsDatetimeAdapterRawModule, never, never, never>;
|
|
141
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<DayjsDatetimeAdapterRawModule>;
|
|
142
|
-
}
|
|
143
160
|
declare class DayjsDatetimeAdapterModule {
|
|
144
161
|
static ɵfac: i0.ɵɵFactoryDeclaration<DayjsDatetimeAdapterModule, never>;
|
|
145
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DayjsDatetimeAdapterModule, never,
|
|
162
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DayjsDatetimeAdapterModule, never, never, never>;
|
|
146
163
|
static ɵinj: i0.ɵɵInjectorDeclaration<DayjsDatetimeAdapterModule>;
|
|
147
164
|
}
|
|
148
165
|
|
|
@@ -150,5 +167,5 @@ declare const DAYJS_DATETIME_FORMATS: DateTimeFormats;
|
|
|
150
167
|
/** Preset for applications that display and accept 24-hour time input. */
|
|
151
168
|
declare const DAYJS_DATETIME_FORMATS_24H: DateTimeFormats;
|
|
152
169
|
|
|
153
|
-
export { DAYJS_DATETIME_FORMATS, DAYJS_DATETIME_FORMATS_24H, DAYJS_DATE_TIME_ADAPTER_OPTIONS, DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY, DayjsDatetimeAdapter, DayjsDatetimeAdapterModule,
|
|
170
|
+
export { DAYJS_DATETIME_FORMATS, DAYJS_DATETIME_FORMATS_24H, DAYJS_DATE_TIME_ADAPTER_OPTIONS, DAYJS_DATE_TIME_ADAPTER_OPTIONS_FACTORY, DayjsDatetimeAdapter, DayjsDatetimeAdapterModule, provideDayjsDatetimeAdapter };
|
|
154
171
|
export type { DayjsDatetimeAdapterOptions };
|