@koobiq/angular-moment-adapter 20.4.2 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/koobiq-angular-moment-adapter-adapter.mjs +19 -15
- package/fesm2022/koobiq-angular-moment-adapter-adapter.mjs.map +1 -1
- package/package.json +10 -7
- package/{adapter/index.d.ts → types/koobiq-angular-moment-adapter-adapter.d.ts} +1 -0
- /package/{index.d.ts → types/koobiq-angular-moment-adapter.d.ts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Injectable, NgModule } from '@angular/core';
|
|
3
3
|
import { KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, KbqDateTimezoneService, DateAdapter, KbqLocaleServiceModule, KBQ_DATE_FORMATS } from '@koobiq/components/core';
|
|
4
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
5
|
import { MomentDateAdapter as MomentDateAdapter$1, MOMENT_DATE_FORMATS } from '@koobiq/moment-date-adapter';
|
|
5
6
|
import { Subject } from 'rxjs';
|
|
6
7
|
|
|
@@ -35,6 +36,7 @@ class MomentDateAdapter extends MomentDateAdapter$1 {
|
|
|
35
36
|
this._localeChanges = new Subject();
|
|
36
37
|
/**
|
|
37
38
|
* Sets the locale used for all dates.
|
|
39
|
+
*
|
|
38
40
|
* @param locale The new locale.
|
|
39
41
|
*/
|
|
40
42
|
this.setLocale = (locale) => {
|
|
@@ -42,8 +44,8 @@ class MomentDateAdapter extends MomentDateAdapter$1 {
|
|
|
42
44
|
this._localeChanges.next();
|
|
43
45
|
};
|
|
44
46
|
this.options = options;
|
|
45
|
-
this.setLocale(this.localeService?.
|
|
46
|
-
this.localeService?.changes.subscribe(this.setLocale);
|
|
47
|
+
this.setLocale(this.localeService?.localeId() || dateLocale);
|
|
48
|
+
this.localeService?.changes.pipe(takeUntilDestroyed()).subscribe(this.setLocale);
|
|
47
49
|
}
|
|
48
50
|
/** A stream that emits when the locale changes. */
|
|
49
51
|
get localeChanges() {
|
|
@@ -125,26 +127,26 @@ class MomentDateAdapter extends MomentDateAdapter$1 {
|
|
|
125
127
|
const settled = this.timezoneService?.offsetAt(shifted.valueOf()) ?? null;
|
|
126
128
|
return settled === null || settled === offset ? shifted : shifted.utcOffset(formatOffset(settled), true);
|
|
127
129
|
}
|
|
128
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
129
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
130
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: MomentDateAdapter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
131
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: MomentDateAdapter }); }
|
|
130
132
|
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: MomentDateAdapter, decorators: [{
|
|
132
134
|
type: Injectable
|
|
133
135
|
}], ctorParameters: () => [] });
|
|
134
136
|
|
|
135
137
|
const KBQ_MOMENT_DATE_FORMATS = MOMENT_DATE_FORMATS;
|
|
136
138
|
|
|
137
139
|
class MomentDateModule {
|
|
138
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
139
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
140
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
140
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: MomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
141
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: MomentDateModule }); }
|
|
142
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: MomentDateModule, providers: [
|
|
141
143
|
{
|
|
142
144
|
provide: DateAdapter,
|
|
143
145
|
useClass: MomentDateAdapter
|
|
144
146
|
}
|
|
145
147
|
] }); }
|
|
146
148
|
}
|
|
147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: MomentDateModule, decorators: [{
|
|
148
150
|
type: NgModule,
|
|
149
151
|
args: [{
|
|
150
152
|
providers: [
|
|
@@ -156,23 +158,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.30", ngImpo
|
|
|
156
158
|
}]
|
|
157
159
|
}] });
|
|
158
160
|
class KbqMomentDateModule {
|
|
159
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
160
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
161
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
161
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqMomentDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
162
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: KbqMomentDateModule, imports: [MomentDateModule, KbqLocaleServiceModule] }); }
|
|
163
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqMomentDateModule, providers: [
|
|
162
164
|
{
|
|
163
|
-
//
|
|
165
|
+
// Resets the date formats of a parent injector: the date input then reads its pattern from the
|
|
166
|
+
// adapter, whose configuration follows the locale of `KbqLocaleService`.
|
|
164
167
|
provide: KBQ_DATE_FORMATS,
|
|
165
168
|
useValue: null
|
|
166
169
|
}
|
|
167
170
|
], imports: [MomentDateModule, KbqLocaleServiceModule] }); }
|
|
168
171
|
}
|
|
169
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
172
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: KbqMomentDateModule, decorators: [{
|
|
170
173
|
type: NgModule,
|
|
171
174
|
args: [{
|
|
172
175
|
imports: [MomentDateModule, KbqLocaleServiceModule],
|
|
173
176
|
providers: [
|
|
174
177
|
{
|
|
175
|
-
//
|
|
178
|
+
// Resets the date formats of a parent injector: the date input then reads its pattern from the
|
|
179
|
+
// adapter, whose configuration follows the locale of `KbqLocaleService`.
|
|
176
180
|
provide: KBQ_DATE_FORMATS,
|
|
177
181
|
useValue: null
|
|
178
182
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"koobiq-angular-moment-adapter-adapter.mjs","sources":["../../../packages/angular-moment-adapter/adapter/moment-date-adapter.ts","../../../packages/angular-moment-adapter/adapter/moment-date-formats.ts","../../../packages/angular-moment-adapter/adapter/index.ts","../../../packages/angular-moment-adapter/adapter/koobiq-angular-moment-adapter-adapter.ts"],"sourcesContent":["import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, KbqDateTimezoneService, KbqLocaleService } from '@koobiq/components/core';\nimport { DateUnit, DurationObjectUnits, DurationUnit } from '@koobiq/date-adapter';\nimport { MomentDateAdapter as BaseMomentDateAdapter, MomentDateAdapterOptions } from '@koobiq/moment-date-adapter';\nimport { Moment } from 'moment';\nimport { Observable, Subject } from 'rxjs';\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport type IKbqMomentDateAdapterOptions = MomentDateAdapterOptions;\n\n/** An ISO date with no time and no offset: it names a calendar day, not an instant. */\nconst DATE_ONLY_ISO_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst MINUTES_PER_HOUR = 60;\n\n/** An offset in minutes as `±HH:mm`, the form moment reads unambiguously. */\nconst formatOffset = (minutes: number): string => {\n const magnitude = Math.abs(minutes);\n const pad = (value: number) => `${Math.floor(value)}`.padStart(2, '0');\n\n return `${minutes < 0 ? '-' : '+'}${pad(magnitude / MINUTES_PER_HOUR)}:${pad(magnitude % MINUTES_PER_HOUR)}`;\n};\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const KBQ_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<IKbqMomentDateAdapterOptions>(\n 'KBQ_MOMENT_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @docs-private */\nexport function KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): IKbqMomentDateAdapterOptions {\n return {\n useUtc: false,\n findDateFormat: false\n };\n}\n\n@Injectable()\nexport class MomentDateAdapter extends BaseMomentDateAdapter {\n protected readonly options?: IKbqMomentDateAdapterOptions;\n private localeService = inject<KbqLocaleService>(KBQ_LOCALE_SERVICE, { optional: true });\n private readonly timezoneService = inject(KbqDateTimezoneService);\n\n constructor() {\n const dateLocale = inject(KBQ_DATE_LOCALE, { optional: true })!;\n const options =\n inject<IKbqMomentDateAdapterOptions>(KBQ_MOMENT_DATE_ADAPTER_OPTIONS, { optional: true }) ?? undefined;\n\n super(dateLocale, options);\n this.options = options;\n\n this.setLocale(this.localeService?.id || dateLocale);\n\n this.localeService?.changes.subscribe(this.setLocale);\n }\n\n /** A stream that emits when the locale changes. */\n get localeChanges(): Observable<any> {\n return this._localeChanges;\n }\n\n private _localeChanges = new Subject<void>();\n\n /**\n * Sets the locale used for all dates.\n * @param locale The new locale.\n */\n setLocale = (locale: any) => {\n super.setLocale(locale);\n this._localeChanges.next();\n };\n\n override today(): Moment {\n return this.applyTimezone(super.today());\n }\n\n override format(date: Moment, displayFormat: string): string {\n return super.format(this.applyTimezone(date), displayFormat);\n }\n\n override startOf(date: Moment, unit: DateUnit): Moment {\n return this.applyTimezone(super.startOf(date, unit), true);\n }\n\n override addCalendarUnits(\n date: Moment,\n amountOrDurationLikeObject: number | DurationObjectUnits,\n unit?: DurationUnit\n ): Moment {\n return this.applyTimezone(super.addCalendarUnits(date, amountOrDurationLikeObject, unit), true);\n }\n\n override addCalendarYears(date: Moment, years: number): Moment {\n return this.applyTimezone(super.addCalendarYears(date, years), true);\n }\n\n override addCalendarMonths(date: Moment, months: number): Moment {\n return this.applyTimezone(super.addCalendarMonths(date, months), true);\n }\n\n override addCalendarDays(date: Moment, days: number): Moment {\n return this.applyTimezone(super.addCalendarDays(date, days), true);\n }\n\n override deserialize(value: any): Moment | null {\n const date = super.deserialize(value);\n\n if (!date) return date;\n\n return this.applyTimezone(date, this.namesWallClock(value));\n }\n\n override parse(value: any, parseFormat: string | string[]): Moment | null {\n const date = super.parse(value, parseFormat);\n\n if (!date) return null;\n\n // Text parsed against a display format is user input: it names wall-clock components in the active\n // zone. Everything else (ISO text, millis, Date) names an instant and must not be shifted.\n const isUserInput = typeof value === 'string' && !!parseFormat;\n\n return this.applyTimezone(date, isUserInput || this.namesWallClock(value));\n }\n\n override createDate(year: number, month?: number, date?: number): Moment {\n // Calendar components name a wall-clock date, so they are kept and only the offset changes.\n // Truncated afterwards because the base builds in the host zone, where the requested midnight may\n // not exist — a DST start at midnight moves it to 01:00 before there is anything to keep.\n return this.applyTimezone(super.createDate(year, month, date), true).startOf('day');\n }\n\n override createDateTime(\n year: number,\n month: number,\n date: number,\n hours: number,\n minutes: number,\n seconds: number,\n milliseconds: number\n ): Moment {\n // The base sets the time components after `createDate`, so the offset pinned at midnight can be\n // the wrong one for the resulting wall clock on the day of a transition.\n return this.applyTimezone(super.createDateTime(year, month, date, hours, minutes, seconds, milliseconds), true);\n }\n\n /** Whether `value` names a calendar day rather than an instant. */\n private namesWallClock(value: any): boolean {\n return typeof value === 'string' && DATE_ONLY_ISO_PATTERN.test(value);\n }\n\n /**\n * Moves a date into the active time zone.\n *\n * Unlike the luxon adapter, the moment one has to do this on the way in: `format()` renders whatever\n * offset the moment itself carries, and the base class builds every date in the host zone.\n *\n * `keepLocalTime` picks between the two meanings a zone change can have - converting an instant\n * (`false`, the default) or reading the same wall-clock components in another zone (`true`).\n */\n private applyTimezone(date: Moment, keepLocalTime = false): Moment {\n // The base constructor builds locale data through `createDate()` before the fields of this class\n // exist, so the very first calls run without a service and are left in the host zone.\n const offset = this.timezoneService?.offsetAt(date.valueOf()) ?? null;\n\n if (offset === null) return date;\n\n // Cloned because moment is mutable and the date may be one the application still holds. The offset\n // goes in as text: moment reads a number below 16 as hours rather than minutes.\n const shifted = date.clone().utcOffset(formatOffset(offset), keepLocalTime);\n\n if (!keepLocalTime) return shifted;\n\n // Keeping the wall clock moves the instant, which can cross a transition — the offset resolved\n // above then belongs to an instant this date no longer denotes.\n const settled = this.timezoneService?.offsetAt(shifted.valueOf()) ?? null;\n\n return settled === null || settled === offset ? shifted : shifted.utcOffset(formatOffset(settled), true);\n }\n}\n","import { MOMENT_DATE_FORMATS } from '@koobiq/moment-date-adapter';\n\nexport const KBQ_MOMENT_DATE_FORMATS = MOMENT_DATE_FORMATS;\n","import { NgModule } from '@angular/core';\nimport { DateAdapter, KBQ_DATE_FORMATS, KbqLocaleServiceModule } from '@koobiq/components/core';\nimport { MomentDateAdapter } from './moment-date-adapter';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter\n }\n ]\n})\nexport class MomentDateModule {}\n\n@NgModule({\n imports: [MomentDateModule, KbqLocaleServiceModule],\n providers: [\n {\n // todo после добавления McLocaleServiceModule возможно уже неактуально\n provide: KBQ_DATE_FORMATS,\n useValue: null\n }\n ]\n})\nexport class KbqMomentDateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BaseMomentDateAdapter"],"mappings":";;;;;;AAUA;AACA,MAAM,qBAAqB,GAAG,qBAAqB;AAEnD,MAAM,gBAAgB,GAAG,EAAE;AAE3B;AACA,MAAM,YAAY,GAAG,CAAC,OAAe,KAAY;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;IACnC,MAAM,GAAG,GAAG,CAAC,KAAa,KAAK,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IAEtE,OAAO,CAAA,EAAG,OAAO,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAA,EAAG,GAAG,CAAC,SAAS,GAAG,gBAAgB,CAAC,CAAA,CAAA,EAAI,GAAG,CAAC,SAAS,GAAG,gBAAgB,CAAC,CAAA,CAAE;AAChH,CAAC;AAED;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC7D,iCAAiC,EACjC;AACI,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AAGL;SACgB,uCAAuC,GAAA;IACnD,OAAO;AACH,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,cAAc,EAAE;KACnB;AACL;AAGM,MAAO,iBAAkB,SAAQA,mBAAqB,CAAA;AAKxD,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,UAAU,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B,gBAAgB,EAGG,sBAAsB,CAAA,EAAA,CAAA,CAAA;AASzC,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAAA,SAAA,EARjB;AACP,YAAA;;AAEI,gBAAA,OAAO,EAAE,gBAAgB;AACzB,gBAAA,QAAQ,EAAE;AACb;SACJ,EAAA,OAAA,EAAA,CAPS,gBAAgB,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;;4FASzC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAV/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;AACnD,oBAAA,SAAS,EAAE;AACP,wBAAA;;AAEI,4BAAA,OAAO,EAAE,gBAAgB;AACzB,4BAAA,QAAQ,EAAE;AACb;AACJ;AACJ,iBAAA;;;AC1BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"koobiq-angular-moment-adapter-adapter.mjs","sources":["../../../packages/angular-moment-adapter/adapter/moment-date-adapter.ts","../../../packages/angular-moment-adapter/adapter/moment-date-formats.ts","../../../packages/angular-moment-adapter/adapter/index.ts","../../../packages/angular-moment-adapter/adapter/koobiq-angular-moment-adapter-adapter.ts"],"sourcesContent":["import { Injectable, InjectionToken, inject } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { KBQ_DATE_LOCALE, KBQ_LOCALE_SERVICE, KbqDateTimezoneService, KbqLocaleService } from '@koobiq/components/core';\nimport { DateUnit, DurationObjectUnits, DurationUnit } from '@koobiq/date-adapter';\nimport { MomentDateAdapter as BaseMomentDateAdapter, MomentDateAdapterOptions } from '@koobiq/moment-date-adapter';\nimport { Moment } from 'moment';\nimport { Observable, Subject } from 'rxjs';\n\n/** Configurable options for {@see MomentDateAdapter}. */\nexport type IKbqMomentDateAdapterOptions = MomentDateAdapterOptions;\n\n/** An ISO date with no time and no offset: it names a calendar day, not an instant. */\nconst DATE_ONLY_ISO_PATTERN = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst MINUTES_PER_HOUR = 60;\n\n/** An offset in minutes as `±HH:mm`, the form moment reads unambiguously. */\nconst formatOffset = (minutes: number): string => {\n const magnitude = Math.abs(minutes);\n const pad = (value: number) => `${Math.floor(value)}`.padStart(2, '0');\n\n return `${minutes < 0 ? '-' : '+'}${pad(magnitude / MINUTES_PER_HOUR)}:${pad(magnitude % MINUTES_PER_HOUR)}`;\n};\n\n/** InjectionToken for moment date adapter to configure options. */\nexport const KBQ_MOMENT_DATE_ADAPTER_OPTIONS = new InjectionToken<IKbqMomentDateAdapterOptions>(\n 'KBQ_MOMENT_DATE_ADAPTER_OPTIONS',\n {\n providedIn: 'root',\n factory: KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY\n }\n);\n\n/** @docs-private */\nexport function KBQ_MOMENT_DATE_ADAPTER_OPTIONS_FACTORY(): IKbqMomentDateAdapterOptions {\n return {\n useUtc: false,\n findDateFormat: false\n };\n}\n\n@Injectable()\nexport class MomentDateAdapter extends BaseMomentDateAdapter {\n protected readonly options?: IKbqMomentDateAdapterOptions;\n private localeService = inject<KbqLocaleService>(KBQ_LOCALE_SERVICE, { optional: true });\n private readonly timezoneService = inject(KbqDateTimezoneService);\n\n constructor() {\n const dateLocale = inject(KBQ_DATE_LOCALE, { optional: true })!;\n const options =\n inject<IKbqMomentDateAdapterOptions>(KBQ_MOMENT_DATE_ADAPTER_OPTIONS, { optional: true }) ?? undefined;\n\n super(dateLocale, options);\n this.options = options;\n\n this.setLocale(this.localeService?.localeId() || dateLocale);\n\n this.localeService?.changes.pipe(takeUntilDestroyed()).subscribe(this.setLocale);\n }\n\n /** A stream that emits when the locale changes. */\n get localeChanges(): Observable<any> {\n return this._localeChanges;\n }\n\n private _localeChanges = new Subject<void>();\n\n /**\n * Sets the locale used for all dates.\n *\n * @param locale The new locale.\n */\n setLocale = (locale: any) => {\n super.setLocale(locale);\n this._localeChanges.next();\n };\n\n override today(): Moment {\n return this.applyTimezone(super.today());\n }\n\n override format(date: Moment, displayFormat: string): string {\n return super.format(this.applyTimezone(date), displayFormat);\n }\n\n override startOf(date: Moment, unit: DateUnit): Moment {\n return this.applyTimezone(super.startOf(date, unit), true);\n }\n\n override addCalendarUnits(\n date: Moment,\n amountOrDurationLikeObject: number | DurationObjectUnits,\n unit?: DurationUnit\n ): Moment {\n return this.applyTimezone(super.addCalendarUnits(date, amountOrDurationLikeObject, unit), true);\n }\n\n override addCalendarYears(date: Moment, years: number): Moment {\n return this.applyTimezone(super.addCalendarYears(date, years), true);\n }\n\n override addCalendarMonths(date: Moment, months: number): Moment {\n return this.applyTimezone(super.addCalendarMonths(date, months), true);\n }\n\n override addCalendarDays(date: Moment, days: number): Moment {\n return this.applyTimezone(super.addCalendarDays(date, days), true);\n }\n\n override deserialize(value: any): Moment | null {\n const date = super.deserialize(value);\n\n if (!date) return date;\n\n return this.applyTimezone(date, this.namesWallClock(value));\n }\n\n override parse(value: any, parseFormat: string | string[]): Moment | null {\n const date = super.parse(value, parseFormat);\n\n if (!date) return null;\n\n // Text parsed against a display format is user input: it names wall-clock components in the active\n // zone. Everything else (ISO text, millis, Date) names an instant and must not be shifted.\n const isUserInput = typeof value === 'string' && !!parseFormat;\n\n return this.applyTimezone(date, isUserInput || this.namesWallClock(value));\n }\n\n override createDate(year: number, month?: number, date?: number): Moment {\n // Calendar components name a wall-clock date, so they are kept and only the offset changes.\n // Truncated afterwards because the base builds in the host zone, where the requested midnight may\n // not exist — a DST start at midnight moves it to 01:00 before there is anything to keep.\n return this.applyTimezone(super.createDate(year, month, date), true).startOf('day');\n }\n\n override createDateTime(\n year: number,\n month: number,\n date: number,\n hours: number,\n minutes: number,\n seconds: number,\n milliseconds: number\n ): Moment {\n // The base sets the time components after `createDate`, so the offset pinned at midnight can be\n // the wrong one for the resulting wall clock on the day of a transition.\n return this.applyTimezone(super.createDateTime(year, month, date, hours, minutes, seconds, milliseconds), true);\n }\n\n /** Whether `value` names a calendar day rather than an instant. */\n private namesWallClock(value: any): boolean {\n return typeof value === 'string' && DATE_ONLY_ISO_PATTERN.test(value);\n }\n\n /**\n * Moves a date into the active time zone.\n *\n * Unlike the luxon adapter, the moment one has to do this on the way in: `format()` renders whatever\n * offset the moment itself carries, and the base class builds every date in the host zone.\n *\n * `keepLocalTime` picks between the two meanings a zone change can have - converting an instant\n * (`false`, the default) or reading the same wall-clock components in another zone (`true`).\n */\n private applyTimezone(date: Moment, keepLocalTime = false): Moment {\n // The base constructor builds locale data through `createDate()` before the fields of this class\n // exist, so the very first calls run without a service and are left in the host zone.\n const offset = this.timezoneService?.offsetAt(date.valueOf()) ?? null;\n\n if (offset === null) return date;\n\n // Cloned because moment is mutable and the date may be one the application still holds. The offset\n // goes in as text: moment reads a number below 16 as hours rather than minutes.\n const shifted = date.clone().utcOffset(formatOffset(offset), keepLocalTime);\n\n if (!keepLocalTime) return shifted;\n\n // Keeping the wall clock moves the instant, which can cross a transition — the offset resolved\n // above then belongs to an instant this date no longer denotes.\n const settled = this.timezoneService?.offsetAt(shifted.valueOf()) ?? null;\n\n return settled === null || settled === offset ? shifted : shifted.utcOffset(formatOffset(settled), true);\n }\n}\n","import { MOMENT_DATE_FORMATS } from '@koobiq/moment-date-adapter';\n\nexport const KBQ_MOMENT_DATE_FORMATS = MOMENT_DATE_FORMATS;\n","import { NgModule } from '@angular/core';\nimport { DateAdapter, KBQ_DATE_FORMATS, KbqLocaleServiceModule } from '@koobiq/components/core';\nimport { MomentDateAdapter } from './moment-date-adapter';\n\nexport * from './moment-date-adapter';\nexport * from './moment-date-formats';\n\n@NgModule({\n providers: [\n {\n provide: DateAdapter,\n useClass: MomentDateAdapter\n }\n ]\n})\nexport class MomentDateModule {}\n\n@NgModule({\n imports: [MomentDateModule, KbqLocaleServiceModule],\n providers: [\n {\n // Resets the date formats of a parent injector: the date input then reads its pattern from the\n // adapter, whose configuration follows the locale of `KbqLocaleService`.\n provide: KBQ_DATE_FORMATS,\n useValue: null\n }\n ]\n})\nexport class KbqMomentDateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["BaseMomentDateAdapter"],"mappings":";;;;;;;AAWA;AACA,MAAM,qBAAqB,GAAG,qBAAqB;AAEnD,MAAM,gBAAgB,GAAG,EAAE;AAE3B;AACA,MAAM,YAAY,GAAG,CAAC,OAAe,KAAY;IAC7C,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;IACnC,MAAM,GAAG,GAAG,CAAC,KAAa,KAAK,CAAA,EAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;IAEtE,OAAO,CAAA,EAAG,OAAO,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAA,EAAG,GAAG,CAAC,SAAS,GAAG,gBAAgB,CAAC,CAAA,CAAA,EAAI,GAAG,CAAC,SAAS,GAAG,gBAAgB,CAAC,CAAA,CAAE;AAChH,CAAC;AAED;MACa,+BAA+B,GAAG,IAAI,cAAc,CAC7D,iCAAiC,EACjC;AACI,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE;AACZ,CAAA;AAGL;SACgB,uCAAuC,GAAA;IACnD,OAAO;AACH,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,cAAc,EAAE;KACnB;AACL;AAGM,MAAO,iBAAkB,SAAQA,mBAAqB,CAAA;AAKxD,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAE;AAC/D,QAAA,MAAM,OAAO,GACT,MAAM,CAA+B,+BAA+B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAA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CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAAA,SAAA,EATjB;AACP,YAAA;;;AAGI,gBAAA,OAAO,EAAE,gBAAgB;AACzB,gBAAA,QAAQ,EAAE;AACb;SACJ,EAAA,OAAA,EAAA,CARS,gBAAgB,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;;4FAUzC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAX/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;AACnD,oBAAA,SAAS,EAAE;AACP,wBAAA;;;AAGI,4BAAA,OAAO,EAAE,gBAAgB;AACzB,4BAAA,QAAQ,EAAE;AACb;AACJ;AACJ,iBAAA;;;AC3BD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koobiq/angular-moment-adapter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "21.0.0",
|
|
4
4
|
"description": "Koobiq Moment Adapter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -13,28 +13,31 @@
|
|
|
13
13
|
],
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@
|
|
16
|
+
"@angular/core": "^21.0.0",
|
|
17
|
+
"@koobiq/moment-date-adapter": "^3.4.0",
|
|
17
18
|
"@koobiq/date-adapter": "^3.0.0",
|
|
18
19
|
"moment": "^2.24.0",
|
|
19
|
-
"@koobiq/components": "
|
|
20
|
+
"@koobiq/components": "^21.0.0",
|
|
21
|
+
"rxjs": "^7.4.0"
|
|
20
22
|
},
|
|
21
23
|
"dependencies": {
|
|
22
24
|
"tslib": "^2.6.2"
|
|
23
25
|
},
|
|
24
26
|
"module": "fesm2022/koobiq-angular-moment-adapter.mjs",
|
|
25
|
-
"typings": "
|
|
27
|
+
"typings": "types/koobiq-angular-moment-adapter.d.ts",
|
|
26
28
|
"exports": {
|
|
27
29
|
"./package.json": {
|
|
28
30
|
"default": "./package.json"
|
|
29
31
|
},
|
|
30
32
|
".": {
|
|
31
|
-
"types": "./
|
|
33
|
+
"types": "./types/koobiq-angular-moment-adapter.d.ts",
|
|
32
34
|
"default": "./fesm2022/koobiq-angular-moment-adapter.mjs"
|
|
33
35
|
},
|
|
34
36
|
"./adapter": {
|
|
35
|
-
"types": "./adapter
|
|
37
|
+
"types": "./types/koobiq-angular-moment-adapter-adapter.d.ts",
|
|
36
38
|
"default": "./fesm2022/koobiq-angular-moment-adapter-adapter.mjs"
|
|
37
39
|
}
|
|
38
40
|
},
|
|
39
|
-
"sideEffects": false
|
|
41
|
+
"sideEffects": false,
|
|
42
|
+
"type": "module"
|
|
40
43
|
}
|
|
File without changes
|