@anglr/datetime 4.0.0-beta.20220525123741 → 4.0.0-beta.20220526094945
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/date-fns/src/misc/tokens.d.ts +1 -5
- package/date-fns/src/misc/tokens.d.ts.map +1 -1
- package/date-fns/src/services/dateFnsDateApi.service.d.ts +5 -0
- package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
- package/es2015/date-fns/src/misc/tokens.js +1 -9
- package/es2015/date-fns/src/misc/tokens.js.map +1 -1
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js +7 -0
- package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
- package/es2015/moment/src/misc/tokens.js +1 -9
- package/es2015/moment/src/misc/tokens.js.map +1 -1
- package/es2015/moment/src/services/momentDateApi.service.js +7 -0
- package/es2015/moment/src/services/momentDateApi.service.js.map +1 -1
- package/es2020/date-fns/src/misc/tokens.js +1 -9
- package/es2020/date-fns/src/misc/tokens.js.map +1 -1
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js +7 -0
- package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
- package/es2020/moment/src/misc/tokens.js +1 -9
- package/es2020/moment/src/misc/tokens.js.map +1 -1
- package/es2020/moment/src/services/momentDateApi.service.js +7 -0
- package/es2020/moment/src/services/momentDateApi.service.js.map +1 -1
- package/moment/src/misc/tokens.d.ts +1 -5
- package/moment/src/misc/tokens.d.ts.map +1 -1
- package/moment/src/services/momentDateApi.service.d.ts +5 -0
- package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
- package/package.json +1 -1
- package/version.bak +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FactoryProvider, InjectionToken } from '@angular/core';
|
|
2
2
|
import { DateFnsLocale } from '../services/dateFnsLocale.service';
|
|
3
3
|
/**
|
|
4
4
|
* Injection token used for obtaining Date fns locale service
|
|
@@ -8,8 +8,4 @@ export declare const DATE_FNS_LOCALE: InjectionToken<DateFnsLocale>;
|
|
|
8
8
|
* Injection token used for obtaining date-fns FormatProvider implementation
|
|
9
9
|
*/
|
|
10
10
|
export declare const DATE_FNS_FORMAT_PROVIDER: FactoryProvider;
|
|
11
|
-
/**
|
|
12
|
-
* Injection token used for injecting type that creates instance of DateApiObject for date-fns
|
|
13
|
-
*/
|
|
14
|
-
export declare const DATE_FNS_DATE_API_OBJECT_TYPE: ClassProvider;
|
|
15
11
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,cAAc,EAAC,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAC,aAAa,EAAC,MAAM,mCAAmC,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,CAAC,aAAa,CAAwD,CAAC;AAEnH;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,eAsBtC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassProvider } from '@angular/core';
|
|
1
2
|
import { DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor } from '@anglr/datetime';
|
|
2
3
|
import { DateFnsLocale } from './dateFnsLocale.service';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
@@ -338,4 +339,8 @@ export declare class DateFnsDateApi implements DateApi<Date> {
|
|
|
338
339
|
* Type that represents creation of DateApiObject for date-fns
|
|
339
340
|
*/
|
|
340
341
|
export declare const dateFnsDateApiObjectType: DateApiObjectCtor<DateFnsDateApiObject, Date>;
|
|
342
|
+
/**
|
|
343
|
+
* Injection token used for injecting type that creates instance of DateApiObject for date-fns
|
|
344
|
+
*/
|
|
345
|
+
export declare const DATE_FNS_DATE_API_OBJECT_TYPE: ClassProvider;
|
|
341
346
|
//# sourceMappingURL=dateFnsDateApi.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFnsDateApi.service.d.ts","sourceRoot":"","sources":["dateFnsDateApi.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dateFnsDateApi.service.d.ts","sourceRoot":"","sources":["dateFnsDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAqB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAKnI,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;;AAEtD;;GAEG;AACH,qBAAa,oBAAqB,YAAW,aAAa,CAAC,IAAI,CAAC;IAmChD,SAAS,CAAC,UAAU,EAAE,aAAa;IA/B/C;;OAEG;IACH,SAAS,CAAC,cAAc,EAAE,IAAI,CAAC;IAE/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC;IAIvB;;OAEG;IACH,IAAW,aAAa,IAAI,IAAI,CAG/B;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,IAAI,CAGvB;gBAGW,KAAK,EAAE,SAAS,GAAC,IAAI,EACrB,MAAM,EAAE,MAAM,GAAC,IAAI,GAAC,SAAS,EACnB,UAAU,EAAE,aAAa;IA2B/C;;OAEG;IACI,OAAO,IAAI,OAAO;IAKzB;;OAEG;IACI,SAAS,IAAI,OAAO;IAK3B;;;OAGG;IACI,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAK3C;;;OAGG;IACI,aAAa,IAAI,aAAa,CAAC,IAAI,CAAC;IAO3C;;;OAGG;IACI,WAAW,IAAI,aAAa,CAAC,IAAI,CAAC;IAOzC;;;OAGG;IACI,WAAW,I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,CAAC;IAK5E;;OAEG;IACI,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC;IAKjC;;;OAGG;IACI,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAuC9C;;OAEG;IACI,kBAAkB,IAAI,OAAO;IAKpC;;OAEG;IACI,aAAa,IAAI,MAAM,EAAE;IAahC;;OAEG;IACI,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI;yCAnGnC,cAAc;6CAAd,cAAc;CAuG1B;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,iBAAiB,CAAC,oBAAoB,EAAE,IAAI,CAAwB,CAAC;AAE5G;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,aAI3C,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { dateFnsDateApiObjectType } from '../services/dateFnsDateApi.service';
|
|
2
|
+
import { FORMAT_PROVIDER } from '@anglr/datetime';
|
|
4
3
|
/**
|
|
5
4
|
* Injection token used for obtaining Date fns locale service
|
|
6
5
|
*/
|
|
@@ -29,11 +28,4 @@ export const DATE_FNS_FORMAT_PROVIDER = {
|
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
|
-
/**
|
|
33
|
-
* Injection token used for injecting type that creates instance of DateApiObject for date-fns
|
|
34
|
-
*/
|
|
35
|
-
export const DATE_FNS_DATE_API_OBJECT_TYPE = {
|
|
36
|
-
provide: DATE_API_OBJECT_TYPE,
|
|
37
|
-
useClass: dateFnsDateApiObjectType
|
|
38
|
-
};
|
|
39
31
|
//# sourceMappingURL=tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../date-fns/src/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../date-fns/src/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAC,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAiB,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAIhE;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkC,IAAI,cAAc,CAAgB,iBAAiB,CAAC,CAAC;AAEnH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACrC;IACI,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,GAAG,EAAE;QAEb,OAAuB;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,IAAI;YACT,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,QAAQ;YACtB,SAAS,EAAE,MAAM;YACjB,cAAc,EAAE,KAAK;SACxB,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import {FactoryProvider, InjectionToken} from '@angular/core';\nimport {FormatProvider, FORMAT_PROVIDER} from '@anglr/datetime';\n\nimport {DateFnsLocale} from '../services/dateFnsLocale.service';\n\n/**\n * Injection token used for obtaining Date fns locale service\n */\nexport const DATE_FNS_LOCALE: InjectionToken<DateFnsLocale> = new InjectionToken<DateFnsLocale>('DATE_FNS_LOCALE');\n\n/**\n * Injection token used for obtaining date-fns FormatProvider implementation\n */\nexport const DATE_FNS_FORMAT_PROVIDER: FactoryProvider =\n{\n provide: FORMAT_PROVIDER,\n useFactory: () =>\n {\n return <FormatProvider>{\n date: 'P',\n dateTime: 'Pp',\n time: 'p',\n year: 'yyyy',\n month: 'MM',\n week: 'ww',\n day: 'dd',\n hour: 'HH',\n minute: 'mm',\n second: 'ss',\n dayName: 'cccc',\n dayNameShort: 'cccccc',\n monthName: 'LLLL',\n monthNameShort: 'LLL'\n };\n }\n};\n"]}
|
|
@@ -543,4 +543,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
543
543
|
* Type that represents creation of DateApiObject for date-fns
|
|
544
544
|
*/
|
|
545
545
|
export const dateFnsDateApiObjectType = DateFnsDateApiObject;
|
|
546
|
+
/**
|
|
547
|
+
* Injection token used for injecting type that creates instance of DateApiObject for date-fns
|
|
548
|
+
*/
|
|
549
|
+
export const DATE_FNS_DATE_API_OBJECT_TYPE = {
|
|
550
|
+
provide: DATE_API_OBJECT_TYPE,
|
|
551
|
+
useClass: dateFnsDateApiObjectType
|
|
552
|
+
};
|
|
546
553
|
//# sourceMappingURL=dateFnsDateApi.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFnsDateApi.service.js","sourceRoot":"","sources":["../../../../date-fns/src/services/dateFnsDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO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BAAwB,GAAkD,oBAAoB,CAAC","sourcesContent":["import {Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent, isString} from '@jscrpt/common';\nimport {toDate, getDate, setDate, isAfter, isBefore, differenceInCalendarDays, format, startOfMonth, endOfMonth, startOfWeek, endOfWeek, startOfDay, endOfDay, addMonths, addWeeks, addDays, subMonths, subWeeks, subDays, getDaysInMonth, isSameDay, isSameWeek, isSameMonth, isValid, parse, parseISO, addYears, subYears, startOfYear, endOfYear, isWeekend, setYear, getYear, isSameYear, startOfDecade, endOfDecade, setMonth, getMonth, setISODay, getISODay, subHours, addHours, endOfHour, startOfHour, startOfMinute, endOfMinute, addMinutes, subMinutes, getHours, setHours, getMinutes, setMinutes, isDate} from 'date-fns';\n\nimport {DATE_FNS_LOCALE} from '../misc/tokens';\nimport {DateFnsLocale} from './dateFnsLocale.service';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: Date;\n\n /**\n * Instance of date\n */\n protected _value: Date;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): Date\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): Date\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|Date,\n format: string|null|undefined,\n protected _localeSvc: DateFnsLocale)\n {\n if(isString(value))\n {\n //ISO string\n if(/^\\d+-\\d+-\\d+(T\\d+:\\d+:\\d+)?/.test(value))\n {\n this._value = this._originalValue = parseISO(value);\n }\n else\n {\n if(isBlank(format))\n {\n throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');\n }\n\n this._value = this._originalValue = parse(value, format, new Date(1970, 0));\n }\n }\n else\n {\n this._value = this._originalValue = toDate(value);\n }\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return isValid(this._value);\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n return isWeekend(this._value);\n }\n\n /**\n * Formats date value\n * @param formatString - Format token used for creating formatted string\n */\n public format(formatString: string): string\n {\n return format(this._value, formatString, {locale: this._localeSvc.locale});\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<Date>\n {\n this._value = startOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<Date>\n {\n this._value = endOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<Date>\n {\n this._value = startOfYear(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<Date>\n {\n this._value = endOfYear(this._value);\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<Date>\n {\n this._value = addYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<Date>\n {\n this._value = subYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<Date>\n {\n this._value = startOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<Date>\n {\n this._value = endOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<Date>\n {\n this._value = addMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<Date>\n {\n this._value = subMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<Date>\n {\n this._value = startOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<Date>\n {\n this._value = endOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<Date>\n {\n this._value = addWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<Date>\n {\n this._value = subWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<Date>\n {\n this._value = startOfDay(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<Date>\n {\n this._value = endOfDay(this._value);\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<Date>\n {\n this._value = addDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<Date>\n {\n this._value = subDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<Date>\n {\n this._value = startOfHour(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<Date>\n {\n this._value = endOfHour(this._value);\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<Date>\n {\n this._value = addHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<Date>\n {\n this._value = subHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<Date>\n {\n this._value = startOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<Date>\n {\n this._value = endOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<Date>\n {\n this._value = addMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<Date>\n {\n this._value = subMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return getDaysInMonth(this._value);\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<Date>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<Date>|number\n {\n if(isPresent(year))\n {\n this._value = setYear(this._value, year);\n\n return this;\n }\n\n return getYear(this._value);\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<Date>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<Date>|number\n {\n if(isPresent(month))\n {\n this._value = setMonth(this._value, month);\n\n return this;\n }\n\n return getMonth(this._value);\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<Date>|number\n {\n if(isPresent(day))\n {\n this._value = setDate(this._value, day);\n\n return this;\n }\n\n return getDate(this._value);\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<Date>\n {\n if(isPresent(day))\n {\n this._value = setISODay(this._value, day + 1!);\n\n return this;\n }\n\n return getISODay(this._value) - 1;\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero based\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<Date>;\n /**\n * Gets or sets hours zero based\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<Date>|number\n {\n if(isPresent(hour))\n {\n this._value = setHours(this._value, hour);\n\n return this;\n }\n\n return getHours(this._value);\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<Date>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<Date>|number\n {\n if(isPresent(minute))\n {\n this._value = setMinutes(this._value, minute);\n\n return this;\n }\n\n return getMinutes(this._value);\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: Date): boolean\n {\n return isBefore(this._value, date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: Date): boolean\n {\n return isAfter(this._value, date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: Date): number\n {\n return differenceInCalendarDays(this._value, date);\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: Date): boolean\n {\n return isSameWeek(this._value, date, {locale: this._localeSvc.locale});\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: Date): boolean\n {\n const year = getYear(this._value);\n const start = year - (year % 10);\n const end = start + 10;\n\n return getYear(date) >= start && getYear(date) < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: Date): boolean\n {\n return isSameYear(this._value, date);\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: Date): boolean\n {\n return isSameMonth(this._value, date);\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: Date): boolean\n {\n return isSameDay(this._value, date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._value), null, this._localeSvc);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._originalValue), null, this._localeSvc);\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: Date): DateApiObject<Date>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<Date>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using DateFnsJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class DateFnsDateApi implements DateApi<Date>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_FNS_LOCALE) protected _localeSvc: DateFnsLocale,\n protected _relativeParser: DateTimeRelativeParser<Date>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<DateFnsDateApiObject, Date>)\n {\n }\n\n //######################### public methods - implementation of DateApi #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|Date, format?: string): DateApiObject<Date>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format, this._localeSvc);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<Date>\n {\n return new this._dateApiObjecType(new Date(), null, this._localeSvc);\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^p+$/i.test(pseudoFormat))\n {\n if(!this._localeSvc.locale.formatLong)\n {\n throw new Error('Missing long formats for locale in DateApi');\n }\n\n const widths: {[index: number]: string} =\n {\n 1: 'short',\n 2: 'medium',\n 3: 'long',\n 4: 'full'\n };\n\n //date time format\n if(pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8)\n {\n const partLength = pseudoFormat.length / 2;\n\n return `${this._localeSvc.locale.formatLong.date({width: widths[partLength]})} ${this._localeSvc.locale.formatLong.time({width: widths[partLength]})}`;\n }\n //date format\n else if(pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.date({width: widths[pseudoFormat.length]});\n }\n //time format\n else if(pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.time({width: widths[pseudoFormat.length]});\n }\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return this._localeSvc.locale.options?.weekStartsOn === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n let startIndex = this._localeSvc.locale.options!.weekStartsOn!;\n const weekdays: string[] = [];\n\n for(let x = 0; x < 7; x++)\n {\n weekdays.push(this._localeSvc.locale.localize!.day(startIndex++ % 7, {width: 'short'}));\n }\n\n return weekdays;\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is Date\n {\n return isDate(value);\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for date-fns\n */\nexport const dateFnsDateApiObjectType: DateApiObjectCtor<DateFnsDateApiObject, Date> = DateFnsDateApiObject;"]}
|
|
1
|
+
{"version":3,"file":"dateFnsDateApi.service.js","sourceRoot":"","sources":["../../../../date-fns/src/services/dateFnsDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE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;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;;2GAtGQ,cAAc,kBAGH,eAAe,mDAEf,oBAAoB;+GAL/B,cAAc;2FAAd,cAAc;kBAD1B,UAAU;;0BAIM,MAAM;2BAAC,eAAe;;0BAEtB,MAAM;2BAAC,oBAAoB;;AAoG5C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkD,oBAAoB,CAAC;AAE5G;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAC1C;IACI,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,wBAAwB;CACrC,CAAC","sourcesContent":["import {ClassProvider, Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent, isString} from '@jscrpt/common';\nimport {toDate, getDate, setDate, isAfter, isBefore, differenceInCalendarDays, format, startOfMonth, endOfMonth, startOfWeek, endOfWeek, startOfDay, endOfDay, addMonths, addWeeks, addDays, subMonths, subWeeks, subDays, getDaysInMonth, isSameDay, isSameWeek, isSameMonth, isValid, parse, parseISO, addYears, subYears, startOfYear, endOfYear, isWeekend, setYear, getYear, isSameYear, startOfDecade, endOfDecade, setMonth, getMonth, setISODay, getISODay, subHours, addHours, endOfHour, startOfHour, startOfMinute, endOfMinute, addMinutes, subMinutes, getHours, setHours, getMinutes, setMinutes, isDate} from 'date-fns';\n\nimport {DATE_FNS_LOCALE} from '../misc/tokens';\nimport {DateFnsLocale} from './dateFnsLocale.service';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: Date;\n\n /**\n * Instance of date\n */\n protected _value: Date;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): Date\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): Date\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|Date,\n format: string|null|undefined,\n protected _localeSvc: DateFnsLocale)\n {\n if(isString(value))\n {\n //ISO string\n if(/^\\d+-\\d+-\\d+(T\\d+:\\d+:\\d+)?/.test(value))\n {\n this._value = this._originalValue = parseISO(value);\n }\n else\n {\n if(isBlank(format))\n {\n throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');\n }\n\n this._value = this._originalValue = parse(value, format, new Date(1970, 0));\n }\n }\n else\n {\n this._value = this._originalValue = toDate(value);\n }\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return isValid(this._value);\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n return isWeekend(this._value);\n }\n\n /**\n * Formats date value\n * @param formatString - Format token used for creating formatted string\n */\n public format(formatString: string): string\n {\n return format(this._value, formatString, {locale: this._localeSvc.locale});\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<Date>\n {\n this._value = startOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<Date>\n {\n this._value = endOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<Date>\n {\n this._value = startOfYear(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<Date>\n {\n this._value = endOfYear(this._value);\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<Date>\n {\n this._value = addYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<Date>\n {\n this._value = subYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<Date>\n {\n this._value = startOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<Date>\n {\n this._value = endOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<Date>\n {\n this._value = addMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<Date>\n {\n this._value = subMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<Date>\n {\n this._value = startOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<Date>\n {\n this._value = endOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<Date>\n {\n this._value = addWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<Date>\n {\n this._value = subWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<Date>\n {\n this._value = startOfDay(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<Date>\n {\n this._value = endOfDay(this._value);\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<Date>\n {\n this._value = addDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<Date>\n {\n this._value = subDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<Date>\n {\n this._value = startOfHour(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<Date>\n {\n this._value = endOfHour(this._value);\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<Date>\n {\n this._value = addHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<Date>\n {\n this._value = subHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<Date>\n {\n this._value = startOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<Date>\n {\n this._value = endOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<Date>\n {\n this._value = addMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<Date>\n {\n this._value = subMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return getDaysInMonth(this._value);\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<Date>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<Date>|number\n {\n if(isPresent(year))\n {\n this._value = setYear(this._value, year);\n\n return this;\n }\n\n return getYear(this._value);\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<Date>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<Date>|number\n {\n if(isPresent(month))\n {\n this._value = setMonth(this._value, month);\n\n return this;\n }\n\n return getMonth(this._value);\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<Date>|number\n {\n if(isPresent(day))\n {\n this._value = setDate(this._value, day);\n\n return this;\n }\n\n return getDate(this._value);\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<Date>\n {\n if(isPresent(day))\n {\n this._value = setISODay(this._value, day + 1!);\n\n return this;\n }\n\n return getISODay(this._value) - 1;\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero based\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<Date>;\n /**\n * Gets or sets hours zero based\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<Date>|number\n {\n if(isPresent(hour))\n {\n this._value = setHours(this._value, hour);\n\n return this;\n }\n\n return getHours(this._value);\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<Date>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<Date>|number\n {\n if(isPresent(minute))\n {\n this._value = setMinutes(this._value, minute);\n\n return this;\n }\n\n return getMinutes(this._value);\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: Date): boolean\n {\n return isBefore(this._value, date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: Date): boolean\n {\n return isAfter(this._value, date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: Date): number\n {\n return differenceInCalendarDays(this._value, date);\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: Date): boolean\n {\n return isSameWeek(this._value, date, {locale: this._localeSvc.locale});\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: Date): boolean\n {\n const year = getYear(this._value);\n const start = year - (year % 10);\n const end = start + 10;\n\n return getYear(date) >= start && getYear(date) < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: Date): boolean\n {\n return isSameYear(this._value, date);\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: Date): boolean\n {\n return isSameMonth(this._value, date);\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: Date): boolean\n {\n return isSameDay(this._value, date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._value), null, this._localeSvc);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._originalValue), null, this._localeSvc);\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: Date): DateApiObject<Date>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<Date>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using DateFnsJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class DateFnsDateApi implements DateApi<Date>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_FNS_LOCALE) protected _localeSvc: DateFnsLocale,\n protected _relativeParser: DateTimeRelativeParser<Date>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<DateFnsDateApiObject, Date>)\n {\n }\n\n //######################### public methods - implementation of DateApi #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|Date, format?: string): DateApiObject<Date>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format, this._localeSvc);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<Date>\n {\n return new this._dateApiObjecType(new Date(), null, this._localeSvc);\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^p+$/i.test(pseudoFormat))\n {\n if(!this._localeSvc.locale.formatLong)\n {\n throw new Error('Missing long formats for locale in DateApi');\n }\n\n const widths: {[index: number]: string} =\n {\n 1: 'short',\n 2: 'medium',\n 3: 'long',\n 4: 'full'\n };\n\n //date time format\n if(pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8)\n {\n const partLength = pseudoFormat.length / 2;\n\n return `${this._localeSvc.locale.formatLong.date({width: widths[partLength]})} ${this._localeSvc.locale.formatLong.time({width: widths[partLength]})}`;\n }\n //date format\n else if(pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.date({width: widths[pseudoFormat.length]});\n }\n //time format\n else if(pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.time({width: widths[pseudoFormat.length]});\n }\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return this._localeSvc.locale.options?.weekStartsOn === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n let startIndex = this._localeSvc.locale.options!.weekStartsOn!;\n const weekdays: string[] = [];\n\n for(let x = 0; x < 7; x++)\n {\n weekdays.push(this._localeSvc.locale.localize!.day(startIndex++ % 7, {width: 'short'}));\n }\n\n return weekdays;\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is Date\n {\n return isDate(value);\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for date-fns\n */\nexport const dateFnsDateApiObjectType: DateApiObjectCtor<DateFnsDateApiObject, Date> = DateFnsDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for date-fns\n */\nexport const DATE_FNS_DATE_API_OBJECT_TYPE: ClassProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useClass: dateFnsDateApiObjectType\n};"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { momentDateApiObjectType } from '../services/momentDateApi.service';
|
|
1
|
+
import { FORMAT_PROVIDER } from '@anglr/datetime';
|
|
3
2
|
/**
|
|
4
3
|
* Injection token used for obtaining moment FormatProvider implementation
|
|
5
4
|
*/
|
|
@@ -24,11 +23,4 @@ export const MOMENT_FORMAT_PROVIDER = {
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
|
-
/**
|
|
28
|
-
* Injection token used for injecting type that creates instance of DateApiObject for moment
|
|
29
|
-
*/
|
|
30
|
-
export const MOMENT_DATE_API_OBJECT_TYPE = {
|
|
31
|
-
provide: DATE_API_OBJECT_TYPE,
|
|
32
|
-
useClass: momentDateApiObjectType
|
|
33
|
-
};
|
|
34
26
|
//# sourceMappingURL=tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../moment/src/misc/tokens.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../moment/src/misc/tokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GACnC;IACI,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,GAAG,EAAE;QAEb,OAAuB;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,IAAI;YACT,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,IAAI;YAClB,SAAS,EAAE,MAAM;YACjB,cAAc,EAAE,KAAK;SACxB,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import {FactoryProvider} from '@angular/core';\nimport {FormatProvider, FORMAT_PROVIDER} from '@anglr/datetime';\n\n/**\n * Injection token used for obtaining moment FormatProvider implementation\n */\nexport const MOMENT_FORMAT_PROVIDER: FactoryProvider =\n{\n provide: FORMAT_PROVIDER,\n useFactory: () =>\n {\n return <FormatProvider>{\n date: 'L',\n dateTime: 'L LT',\n time: 'LT',\n year: 'YYYY',\n month: 'MM',\n week: 'ww',\n day: 'DD',\n hour: 'HH',\n minute: 'mm',\n second: 'ss',\n dayName: 'dddd',\n dayNameShort: 'dd',\n monthName: 'MMMM',\n monthNameShort: 'MMM'\n };\n }\n};\n"]}
|
|
@@ -499,4 +499,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
499
499
|
* Type that represents creation of DateApiObject for moment
|
|
500
500
|
*/
|
|
501
501
|
export const momentDateApiObjectType = MomentDateApiObject;
|
|
502
|
+
/**
|
|
503
|
+
* Injection token used for injecting type that creates instance of DateApiObject for moment
|
|
504
|
+
*/
|
|
505
|
+
export const MOMENT_DATE_API_OBJECT_TYPE = {
|
|
506
|
+
provide: DATE_API_OBJECT_TYPE,
|
|
507
|
+
useClass: momentDateApiObjectType
|
|
508
|
+
};
|
|
502
509
|
//# sourceMappingURL=momentDateApi.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACj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BAAoB;8GAJ/B,aAAa;2FAAb,aAAa;kBADzB,UAAU;;0BAKM,MAAM;2BAAC,oBAAoB;;AA+D5C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA0D,mBAAmB,CAAC","sourcesContent":["import {Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n protected _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = (this._value.year() % 10);\n\n this._value = moment(this._value).subtract(diff, 'years').startOf('year');\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = 9 - (this._value.year() % 10);\n\n this._value = moment(this._value).add(diff, 'years').endOf('year');\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('year');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('year');\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('month');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('month');\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('week');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('week');\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('day');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('day');\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('hour');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('hour');\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('minute');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('minute');\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return this._value.daysInMonth();\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(year))\n {\n this._value = moment(this._value).year(year);\n\n return this;\n }\n\n return this._value.year();\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<moment.Moment>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(month))\n {\n this._value = moment(this._value).month(month);\n\n return this;\n }\n\n return this._value.month();\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).date(day);\n\n return this;\n }\n\n return this._value.date();\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<moment.Moment>\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).weekday(day);\n\n return this;\n }\n\n return this._value.weekday();\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(hour))\n {\n this._value = moment(this._value).hours(hour);\n\n return this;\n }\n\n return this._value.hours();\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(minute))\n {\n this._value = moment(this._value).minutes(minute);\n\n return this;\n }\n\n return this._value.minutes();\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: moment.Moment): boolean\n {\n return this._value.isBefore(date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: moment.Moment): boolean\n {\n return this._value.isAfter(date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: moment.Moment): number\n {\n return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'week');\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: moment.Moment): boolean\n {\n const year = this._value.year();\n const start = year - (year % 10);\n const end = start + 10;\n\n return date.year() >= start && date.year() < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'year');\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'month');\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'day');\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._value));\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._originalValue));\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: moment.Moment): DateApiObject<moment.Moment>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<moment.Moment>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<MomentDateApiObject, moment.Moment>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for moment\n */\nexport const momentDateApiObjectType: DateApiObjectCtor<MomentDateApiObject, moment.Moment> = MomentDateApiObject;"]}
|
|
1
|
+
{"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAgC5B,iEAAiE;IACjE,YAAY,KAA8B,EAAE,MAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAtBD,yGAAyG;IAEzG;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAQD,sGAAsG;IAEtG;;OAEG;IACI,OAAO;QAEV,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,SAAS;QAEZ,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAEzC,OAAO,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAc;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CA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,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,aAAa;QAEhB,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,KAAK,YAAY,MAAM,CAAC;IACnC,CAAC;;0GAhEQ,aAAa,wDAIF,oBAAoB;8GAJ/B,aAAa;2FAAb,aAAa;kBADzB,UAAU;;0BAKM,MAAM;2BAAC,oBAAoB;;AA+D5C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA0D,mBAAmB,CAAC;AAElH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACxC;IACI,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,uBAAuB;CACpC,CAAC","sourcesContent":["import {ClassProvider, Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n protected _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = (this._value.year() % 10);\n\n this._value = moment(this._value).subtract(diff, 'years').startOf('year');\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = 9 - (this._value.year() % 10);\n\n this._value = moment(this._value).add(diff, 'years').endOf('year');\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('year');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('year');\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('month');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('month');\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('week');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('week');\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('day');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('day');\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('hour');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('hour');\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('minute');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('minute');\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return this._value.daysInMonth();\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(year))\n {\n this._value = moment(this._value).year(year);\n\n return this;\n }\n\n return this._value.year();\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<moment.Moment>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(month))\n {\n this._value = moment(this._value).month(month);\n\n return this;\n }\n\n return this._value.month();\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).date(day);\n\n return this;\n }\n\n return this._value.date();\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<moment.Moment>\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).weekday(day);\n\n return this;\n }\n\n return this._value.weekday();\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(hour))\n {\n this._value = moment(this._value).hours(hour);\n\n return this;\n }\n\n return this._value.hours();\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(minute))\n {\n this._value = moment(this._value).minutes(minute);\n\n return this;\n }\n\n return this._value.minutes();\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: moment.Moment): boolean\n {\n return this._value.isBefore(date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: moment.Moment): boolean\n {\n return this._value.isAfter(date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: moment.Moment): number\n {\n return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'week');\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: moment.Moment): boolean\n {\n const year = this._value.year();\n const start = year - (year % 10);\n const end = start + 10;\n\n return date.year() >= start && date.year() < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'year');\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'month');\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'day');\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._value));\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._originalValue));\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: moment.Moment): DateApiObject<moment.Moment>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<moment.Moment>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<MomentDateApiObject, moment.Moment>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for moment\n */\nexport const momentDateApiObjectType: DateApiObjectCtor<MomentDateApiObject, moment.Moment> = MomentDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for moment\n */\nexport const MOMENT_DATE_API_OBJECT_TYPE: ClassProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useClass: momentDateApiObjectType\n};\n"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { dateFnsDateApiObjectType } from '../services/dateFnsDateApi.service';
|
|
2
|
+
import { FORMAT_PROVIDER } from '@anglr/datetime';
|
|
4
3
|
/**
|
|
5
4
|
* Injection token used for obtaining Date fns locale service
|
|
6
5
|
*/
|
|
@@ -29,11 +28,4 @@ export const DATE_FNS_FORMAT_PROVIDER = {
|
|
|
29
28
|
};
|
|
30
29
|
}
|
|
31
30
|
};
|
|
32
|
-
/**
|
|
33
|
-
* Injection token used for injecting type that creates instance of DateApiObject for date-fns
|
|
34
|
-
*/
|
|
35
|
-
export const DATE_FNS_DATE_API_OBJECT_TYPE = {
|
|
36
|
-
provide: DATE_API_OBJECT_TYPE,
|
|
37
|
-
useClass: dateFnsDateApiObjectType
|
|
38
|
-
};
|
|
39
31
|
//# sourceMappingURL=tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../date-fns/src/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../date-fns/src/misc/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,cAAc,EAAC,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAiB,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAIhE;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkC,IAAI,cAAc,CAAgB,iBAAiB,CAAC,CAAC;AAEnH;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GACrC;IACI,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,GAAG,EAAE;QAEb,OAAuB;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,IAAI;YACT,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,QAAQ;YACtB,SAAS,EAAE,MAAM;YACjB,cAAc,EAAE,KAAK;SACxB,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import {FactoryProvider, InjectionToken} from '@angular/core';\nimport {FormatProvider, FORMAT_PROVIDER} from '@anglr/datetime';\n\nimport {DateFnsLocale} from '../services/dateFnsLocale.service';\n\n/**\n * Injection token used for obtaining Date fns locale service\n */\nexport const DATE_FNS_LOCALE: InjectionToken<DateFnsLocale> = new InjectionToken<DateFnsLocale>('DATE_FNS_LOCALE');\n\n/**\n * Injection token used for obtaining date-fns FormatProvider implementation\n */\nexport const DATE_FNS_FORMAT_PROVIDER: FactoryProvider =\n{\n provide: FORMAT_PROVIDER,\n useFactory: () =>\n {\n return <FormatProvider>{\n date: 'P',\n dateTime: 'Pp',\n time: 'p',\n year: 'yyyy',\n month: 'MM',\n week: 'ww',\n day: 'dd',\n hour: 'HH',\n minute: 'mm',\n second: 'ss',\n dayName: 'cccc',\n dayNameShort: 'cccccc',\n monthName: 'LLLL',\n monthNameShort: 'LLL'\n };\n }\n};\n"]}
|
|
@@ -542,4 +542,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
542
542
|
* Type that represents creation of DateApiObject for date-fns
|
|
543
543
|
*/
|
|
544
544
|
export const dateFnsDateApiObjectType = DateFnsDateApiObject;
|
|
545
|
+
/**
|
|
546
|
+
* Injection token used for injecting type that creates instance of DateApiObject for date-fns
|
|
547
|
+
*/
|
|
548
|
+
export const DATE_FNS_DATE_API_OBJECT_TYPE = {
|
|
549
|
+
provide: DATE_API_OBJECT_TYPE,
|
|
550
|
+
useClass: dateFnsDateApiObjectType
|
|
551
|
+
};
|
|
545
552
|
//# sourceMappingURL=dateFnsDateApi.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dateFnsDateApi.service.js","sourceRoot":"","sources":["../../../../date-fns/src/services/dateFnsDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAA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gBACI,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAC,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAC,CAAC,CAAC;aACvF;SACJ;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,kBAAkB;QAErB,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,KAAK,CAAC,CAAC;IAC9D,CAAC;IAED;;OAEG;IACI,aAAa;QAEhB,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAQ,CAAC,YAAa,CAAC;QAC/D,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EACzB;YACI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAS,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;SAC3F;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;;2GAtGQ,cAAc,kBAGH,eAAe,mDAEf,oBAAoB;+GAL/B,cAAc;2FAAd,cAAc;kBAD1B,UAAU;;0BAIM,MAAM;2BAAC,eAAe;;0BAEtB,MAAM;2BAAC,oBAAoB;;AAoG5C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkD,oBAAoB,CAAC","sourcesContent":["import {Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent, isString} from '@jscrpt/common';\nimport {toDate, getDate, setDate, isAfter, isBefore, differenceInCalendarDays, format, startOfMonth, endOfMonth, startOfWeek, endOfWeek, startOfDay, endOfDay, addMonths, addWeeks, addDays, subMonths, subWeeks, subDays, getDaysInMonth, isSameDay, isSameWeek, isSameMonth, isValid, parse, parseISO, addYears, subYears, startOfYear, endOfYear, isWeekend, setYear, getYear, isSameYear, startOfDecade, endOfDecade, setMonth, getMonth, setISODay, getISODay, subHours, addHours, endOfHour, startOfHour, startOfMinute, endOfMinute, addMinutes, subMinutes, getHours, setHours, getMinutes, setMinutes, isDate} from 'date-fns';\n\nimport {DATE_FNS_LOCALE} from '../misc/tokens';\nimport {DateFnsLocale} from './dateFnsLocale.service';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: Date;\n\n /**\n * Instance of date\n */\n protected _value: Date;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): Date\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): Date\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|Date,\n format: string|null|undefined,\n protected _localeSvc: DateFnsLocale)\n {\n if(isString(value))\n {\n //ISO string\n if(/^\\d+-\\d+-\\d+(T\\d+:\\d+:\\d+)?/.test(value))\n {\n this._value = this._originalValue = parseISO(value);\n }\n else\n {\n if(isBlank(format))\n {\n throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');\n }\n\n this._value = this._originalValue = parse(value, format, new Date(1970, 0));\n }\n }\n else\n {\n this._value = this._originalValue = toDate(value);\n }\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return isValid(this._value);\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n return isWeekend(this._value);\n }\n\n /**\n * Formats date value\n * @param formatString - Format token used for creating formatted string\n */\n public format(formatString: string): string\n {\n return format(this._value, formatString, {locale: this._localeSvc.locale});\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<Date>\n {\n this._value = startOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<Date>\n {\n this._value = endOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<Date>\n {\n this._value = startOfYear(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<Date>\n {\n this._value = endOfYear(this._value);\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<Date>\n {\n this._value = addYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<Date>\n {\n this._value = subYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<Date>\n {\n this._value = startOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<Date>\n {\n this._value = endOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<Date>\n {\n this._value = addMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<Date>\n {\n this._value = subMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<Date>\n {\n this._value = startOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<Date>\n {\n this._value = endOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<Date>\n {\n this._value = addWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<Date>\n {\n this._value = subWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<Date>\n {\n this._value = startOfDay(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<Date>\n {\n this._value = endOfDay(this._value);\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<Date>\n {\n this._value = addDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<Date>\n {\n this._value = subDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<Date>\n {\n this._value = startOfHour(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<Date>\n {\n this._value = endOfHour(this._value);\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<Date>\n {\n this._value = addHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<Date>\n {\n this._value = subHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<Date>\n {\n this._value = startOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<Date>\n {\n this._value = endOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<Date>\n {\n this._value = addMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<Date>\n {\n this._value = subMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return getDaysInMonth(this._value);\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<Date>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<Date>|number\n {\n if(isPresent(year))\n {\n this._value = setYear(this._value, year);\n\n return this;\n }\n\n return getYear(this._value);\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<Date>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<Date>|number\n {\n if(isPresent(month))\n {\n this._value = setMonth(this._value, month);\n\n return this;\n }\n\n return getMonth(this._value);\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<Date>|number\n {\n if(isPresent(day))\n {\n this._value = setDate(this._value, day);\n\n return this;\n }\n\n return getDate(this._value);\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<Date>\n {\n if(isPresent(day))\n {\n this._value = setISODay(this._value, day + 1!);\n\n return this;\n }\n\n return getISODay(this._value) - 1;\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero based\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<Date>;\n /**\n * Gets or sets hours zero based\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<Date>|number\n {\n if(isPresent(hour))\n {\n this._value = setHours(this._value, hour);\n\n return this;\n }\n\n return getHours(this._value);\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<Date>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<Date>|number\n {\n if(isPresent(minute))\n {\n this._value = setMinutes(this._value, minute);\n\n return this;\n }\n\n return getMinutes(this._value);\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: Date): boolean\n {\n return isBefore(this._value, date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: Date): boolean\n {\n return isAfter(this._value, date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: Date): number\n {\n return differenceInCalendarDays(this._value, date);\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: Date): boolean\n {\n return isSameWeek(this._value, date, {locale: this._localeSvc.locale});\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: Date): boolean\n {\n const year = getYear(this._value);\n const start = year - (year % 10);\n const end = start + 10;\n\n return getYear(date) >= start && getYear(date) < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: Date): boolean\n {\n return isSameYear(this._value, date);\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: Date): boolean\n {\n return isSameMonth(this._value, date);\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: Date): boolean\n {\n return isSameDay(this._value, date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._value), null, this._localeSvc);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._originalValue), null, this._localeSvc);\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: Date): DateApiObject<Date>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<Date>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using DateFnsJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class DateFnsDateApi implements DateApi<Date>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_FNS_LOCALE) protected _localeSvc: DateFnsLocale,\n protected _relativeParser: DateTimeRelativeParser<Date>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<DateFnsDateApiObject, Date>)\n {\n }\n\n //######################### public methods - implementation of DateApi #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|Date, format?: string): DateApiObject<Date>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format, this._localeSvc);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<Date>\n {\n return new this._dateApiObjecType(new Date(), null, this._localeSvc);\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^p+$/i.test(pseudoFormat))\n {\n if(!this._localeSvc.locale.formatLong)\n {\n throw new Error('Missing long formats for locale in DateApi');\n }\n\n const widths: {[index: number]: string} =\n {\n 1: 'short',\n 2: 'medium',\n 3: 'long',\n 4: 'full'\n };\n\n //date time format\n if(pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8)\n {\n const partLength = pseudoFormat.length / 2;\n\n return `${this._localeSvc.locale.formatLong.date({width: widths[partLength]})} ${this._localeSvc.locale.formatLong.time({width: widths[partLength]})}`;\n }\n //date format\n else if(pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.date({width: widths[pseudoFormat.length]});\n }\n //time format\n else if(pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.time({width: widths[pseudoFormat.length]});\n }\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return this._localeSvc.locale.options?.weekStartsOn === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n let startIndex = this._localeSvc.locale.options!.weekStartsOn!;\n const weekdays: string[] = [];\n\n for(let x = 0; x < 7; x++)\n {\n weekdays.push(this._localeSvc.locale.localize!.day(startIndex++ % 7, {width: 'short'}));\n }\n\n return weekdays;\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is Date\n {\n return isDate(value);\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for date-fns\n */\nexport const dateFnsDateApiObjectType: DateApiObjectCtor<DateFnsDateApiObject, Date> = DateFnsDateApiObject;"]}
|
|
1
|
+
{"version":3,"file":"dateFnsDateApi.service.js","sourceRoot":"","sources":["../../../../date-fns/src/services/dateFnsDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE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/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent, isString} from '@jscrpt/common';\nimport {toDate, getDate, setDate, isAfter, isBefore, differenceInCalendarDays, format, startOfMonth, endOfMonth, startOfWeek, endOfWeek, startOfDay, endOfDay, addMonths, addWeeks, addDays, subMonths, subWeeks, subDays, getDaysInMonth, isSameDay, isSameWeek, isSameMonth, isValid, parse, parseISO, addYears, subYears, startOfYear, endOfYear, isWeekend, setYear, getYear, isSameYear, startOfDecade, endOfDecade, setMonth, getMonth, setISODay, getISODay, subHours, addHours, endOfHour, startOfHour, startOfMinute, endOfMinute, addMinutes, subMinutes, getHours, setHours, getMinutes, setMinutes, isDate} from 'date-fns';\n\nimport {DATE_FNS_LOCALE} from '../misc/tokens';\nimport {DateFnsLocale} from './dateFnsLocale.service';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: Date;\n\n /**\n * Instance of date\n */\n protected _value: Date;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): Date\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): Date\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|Date,\n format: string|null|undefined,\n protected _localeSvc: DateFnsLocale)\n {\n if(isString(value))\n {\n //ISO string\n if(/^\\d+-\\d+-\\d+(T\\d+:\\d+:\\d+)?/.test(value))\n {\n this._value = this._originalValue = parseISO(value);\n }\n else\n {\n if(isBlank(format))\n {\n throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');\n }\n\n this._value = this._originalValue = parse(value, format, new Date(1970, 0));\n }\n }\n else\n {\n this._value = this._originalValue = toDate(value);\n }\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return isValid(this._value);\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n return isWeekend(this._value);\n }\n\n /**\n * Formats date value\n * @param formatString - Format token used for creating formatted string\n */\n public format(formatString: string): string\n {\n return format(this._value, formatString, {locale: this._localeSvc.locale});\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<Date>\n {\n this._value = startOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<Date>\n {\n this._value = endOfDecade(this._value);\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<Date>\n {\n this._value = startOfYear(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<Date>\n {\n this._value = endOfYear(this._value);\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<Date>\n {\n this._value = addYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<Date>\n {\n this._value = subYears(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<Date>\n {\n this._value = startOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<Date>\n {\n this._value = endOfMonth(this._value);\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<Date>\n {\n this._value = addMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<Date>\n {\n this._value = subMonths(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<Date>\n {\n this._value = startOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<Date>\n {\n this._value = endOfWeek(this._value, {locale: this._localeSvc.locale});\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<Date>\n {\n this._value = addWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<Date>\n {\n this._value = subWeeks(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<Date>\n {\n this._value = startOfDay(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<Date>\n {\n this._value = endOfDay(this._value);\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<Date>\n {\n this._value = addDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<Date>\n {\n this._value = subDays(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<Date>\n {\n this._value = startOfHour(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<Date>\n {\n this._value = endOfHour(this._value);\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<Date>\n {\n this._value = addHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<Date>\n {\n this._value = subHours(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<Date>\n {\n this._value = startOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<Date>\n {\n this._value = endOfMinute(this._value);\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<Date>\n {\n this._value = addMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<Date>\n {\n this._value = subMinutes(this._value, count ?? 1);\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return getDaysInMonth(this._value);\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<Date>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<Date>|number\n {\n if(isPresent(year))\n {\n this._value = setYear(this._value, year);\n\n return this;\n }\n\n return getYear(this._value);\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<Date>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<Date>|number\n {\n if(isPresent(month))\n {\n this._value = setMonth(this._value, month);\n\n return this;\n }\n\n return getMonth(this._value);\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<Date>|number\n {\n if(isPresent(day))\n {\n this._value = setDate(this._value, day);\n\n return this;\n }\n\n return getDate(this._value);\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<Date>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<Date>\n {\n if(isPresent(day))\n {\n this._value = setISODay(this._value, day + 1!);\n\n return this;\n }\n\n return getISODay(this._value) - 1;\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero based\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<Date>;\n /**\n * Gets or sets hours zero based\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<Date>|number\n {\n if(isPresent(hour))\n {\n this._value = setHours(this._value, hour);\n\n return this;\n }\n\n return getHours(this._value);\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<Date>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<Date>|number\n {\n if(isPresent(minute))\n {\n this._value = setMinutes(this._value, minute);\n\n return this;\n }\n\n return getMinutes(this._value);\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: Date): boolean\n {\n return isBefore(this._value, date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: Date): boolean\n {\n return isAfter(this._value, date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: Date): number\n {\n return differenceInCalendarDays(this._value, date);\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: Date): boolean\n {\n return isSameWeek(this._value, date, {locale: this._localeSvc.locale});\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: Date): boolean\n {\n const year = getYear(this._value);\n const start = year - (year % 10);\n const end = start + 10;\n\n return getYear(date) >= start && getYear(date) < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: Date): boolean\n {\n return isSameYear(this._value, date);\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: Date): boolean\n {\n return isSameMonth(this._value, date);\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: Date): boolean\n {\n return isSameDay(this._value, date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._value), null, this._localeSvc);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._originalValue), null, this._localeSvc);\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: Date): DateApiObject<Date>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<Date>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using DateFnsJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class DateFnsDateApi implements DateApi<Date>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_FNS_LOCALE) protected _localeSvc: DateFnsLocale,\n protected _relativeParser: DateTimeRelativeParser<Date>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<DateFnsDateApiObject, Date>)\n {\n }\n\n //######################### public methods - implementation of DateApi #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|Date, format?: string): DateApiObject<Date>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format, this._localeSvc);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<Date>\n {\n return new this._dateApiObjecType(new Date(), null, this._localeSvc);\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^p+$/i.test(pseudoFormat))\n {\n if(!this._localeSvc.locale.formatLong)\n {\n throw new Error('Missing long formats for locale in DateApi');\n }\n\n const widths: {[index: number]: string} =\n {\n 1: 'short',\n 2: 'medium',\n 3: 'long',\n 4: 'full'\n };\n\n //date time format\n if(pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8)\n {\n const partLength = pseudoFormat.length / 2;\n\n return `${this._localeSvc.locale.formatLong.date({width: widths[partLength]})} ${this._localeSvc.locale.formatLong.time({width: widths[partLength]})}`;\n }\n //date format\n else if(pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.date({width: widths[pseudoFormat.length]});\n }\n //time format\n else if(pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.time({width: widths[pseudoFormat.length]});\n }\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return this._localeSvc.locale.options?.weekStartsOn === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n let startIndex = this._localeSvc.locale.options!.weekStartsOn!;\n const weekdays: string[] = [];\n\n for(let x = 0; x < 7; x++)\n {\n weekdays.push(this._localeSvc.locale.localize!.day(startIndex++ % 7, {width: 'short'}));\n }\n\n return weekdays;\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is Date\n {\n return isDate(value);\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for date-fns\n */\nexport const dateFnsDateApiObjectType: DateApiObjectCtor<DateFnsDateApiObject, Date> = DateFnsDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for date-fns\n */\nexport const DATE_FNS_DATE_API_OBJECT_TYPE: ClassProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useClass: dateFnsDateApiObjectType\n};"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { momentDateApiObjectType } from '../services/momentDateApi.service';
|
|
1
|
+
import { FORMAT_PROVIDER } from '@anglr/datetime';
|
|
3
2
|
/**
|
|
4
3
|
* Injection token used for obtaining moment FormatProvider implementation
|
|
5
4
|
*/
|
|
@@ -24,11 +23,4 @@ export const MOMENT_FORMAT_PROVIDER = {
|
|
|
24
23
|
};
|
|
25
24
|
}
|
|
26
25
|
};
|
|
27
|
-
/**
|
|
28
|
-
* Injection token used for injecting type that creates instance of DateApiObject for moment
|
|
29
|
-
*/
|
|
30
|
-
export const MOMENT_DATE_API_OBJECT_TYPE = {
|
|
31
|
-
provide: DATE_API_OBJECT_TYPE,
|
|
32
|
-
useClass: momentDateApiObjectType
|
|
33
|
-
};
|
|
34
26
|
//# sourceMappingURL=tokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../moment/src/misc/tokens.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../moment/src/misc/tokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GACnC;IACI,OAAO,EAAE,eAAe;IACxB,UAAU,EAAE,GAAG,EAAE;QAEb,OAAuB;YACnB,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;YACZ,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,IAAI;YACT,IAAI,EAAE,IAAI;YACV,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,IAAI;YAClB,SAAS,EAAE,MAAM;YACjB,cAAc,EAAE,KAAK;SACxB,CAAC;IACN,CAAC;CACJ,CAAC","sourcesContent":["import {FactoryProvider} from '@angular/core';\nimport {FormatProvider, FORMAT_PROVIDER} from '@anglr/datetime';\n\n/**\n * Injection token used for obtaining moment FormatProvider implementation\n */\nexport const MOMENT_FORMAT_PROVIDER: FactoryProvider =\n{\n provide: FORMAT_PROVIDER,\n useFactory: () =>\n {\n return <FormatProvider>{\n date: 'L',\n dateTime: 'L LT',\n time: 'LT',\n year: 'YYYY',\n month: 'MM',\n week: 'ww',\n day: 'DD',\n hour: 'HH',\n minute: 'mm',\n second: 'ss',\n dayName: 'dddd',\n dayNameShort: 'dd',\n monthName: 'MMMM',\n monthNameShort: 'MMM'\n };\n }\n};\n"]}
|
|
@@ -499,4 +499,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImpor
|
|
|
499
499
|
* Type that represents creation of DateApiObject for moment
|
|
500
500
|
*/
|
|
501
501
|
export const momentDateApiObjectType = MomentDateApiObject;
|
|
502
|
+
/**
|
|
503
|
+
* Injection token used for injecting type that creates instance of DateApiObject for moment
|
|
504
|
+
*/
|
|
505
|
+
export const MOMENT_DATE_API_OBJECT_TYPE = {
|
|
506
|
+
provide: DATE_API_OBJECT_TYPE,
|
|
507
|
+
useClass: momentDateApiObjectType
|
|
508
|
+
};
|
|
502
509
|
//# sourceMappingURL=momentDateApi.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAgC5B,iEAAiE;IACjE,YAAY,KAA8B,EAAE,MAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAtBD,yGAAyG;IAEzG;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QAEZ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AM,CAAC,UAAU,EAAE,CAAC,cAAc,CAAC,GAAwB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrH;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,kBAAkB;QAErB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,aAAa;QAEhB,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,KAAK,YAAY,MAAM,CAAC;IACnC,CAAC;;0GAhEQ,aAAa,wDAIF,oBAAoB;8GAJ/B,aAAa;2FAAb,aAAa;kBADzB,UAAU;;0BAKM,MAAM;2BAAC,oBAAoB;;AA+D5C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA0D,mBAAmB,CAAC","sourcesContent":["import {Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n protected _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = (this._value.year() % 10);\n\n this._value = moment(this._value).subtract(diff, 'years').startOf('year');\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = 9 - (this._value.year() % 10);\n\n this._value = moment(this._value).add(diff, 'years').endOf('year');\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('year');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('year');\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('month');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('month');\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('week');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('week');\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('day');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('day');\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('hour');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('hour');\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('minute');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('minute');\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return this._value.daysInMonth();\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(year))\n {\n this._value = moment(this._value).year(year);\n\n return this;\n }\n\n return this._value.year();\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<moment.Moment>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(month))\n {\n this._value = moment(this._value).month(month);\n\n return this;\n }\n\n return this._value.month();\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).date(day);\n\n return this;\n }\n\n return this._value.date();\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<moment.Moment>\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).weekday(day);\n\n return this;\n }\n\n return this._value.weekday();\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(hour))\n {\n this._value = moment(this._value).hours(hour);\n\n return this;\n }\n\n return this._value.hours();\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(minute))\n {\n this._value = moment(this._value).minutes(minute);\n\n return this;\n }\n\n return this._value.minutes();\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: moment.Moment): boolean\n {\n return this._value.isBefore(date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: moment.Moment): boolean\n {\n return this._value.isAfter(date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: moment.Moment): number\n {\n return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'week');\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: moment.Moment): boolean\n {\n const year = this._value.year();\n const start = year - (year % 10);\n const end = start + 10;\n\n return date.year() >= start && date.year() < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'year');\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'month');\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'day');\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._value));\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._originalValue));\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: moment.Moment): DateApiObject<moment.Moment>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<moment.Moment>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<MomentDateApiObject, moment.Moment>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for moment\n */\nexport const momentDateApiObjectType: DateApiObjectCtor<MomentDateApiObject, moment.Moment> = MomentDateApiObject;"]}
|
|
1
|
+
{"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAC,MAAM,iBAAiB,CAAC;AACnI,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAgC5B,iEAAiE;IACjE,YAAY,KAA8B,EAAE,MAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAtBD,yGAAyG;IAEzG;;OAEG;IACH,IAAW,aAAa;QAEpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAQD,sG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CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACrH;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,kBAAkB;QAErB,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACI,aAAa;QAEhB,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,KAAK,YAAY,MAAM,CAAC;IACnC,CAAC;;0GAhEQ,aAAa,wDAIF,oBAAoB;8GAJ/B,aAAa;2FAAb,aAAa;kBADzB,UAAU;;0BAKM,MAAM;2BAAC,oBAAoB;;AA+D5C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA0D,mBAAmB,CAAC;AAElH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACxC;IACI,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,uBAAuB;CACpC,CAAC","sourcesContent":["import {ClassProvider, Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n protected _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n public startOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = (this._value.year() % 10);\n\n this._value = moment(this._value).subtract(diff, 'years').startOf('year');\n \n return this;\n }\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n public endOfDecade(): DateApiObject<moment.Moment>\n {\n const diff = 9 - (this._value.year() % 10);\n\n this._value = moment(this._value).add(diff, 'years').endOf('year');\n \n return this;\n }\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n public startOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('year');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n public endOfYear(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('year');\n\n return this;\n }\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public addYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n public subtractYears(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'years');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n public startOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('month');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n public endOfMonth(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('month');\n\n return this;\n }\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public addMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n public subtractMonths(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'months');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n public startOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('week');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n public endOfWeek(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('week');\n\n return this;\n }\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public addWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n public subtractWeeks(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'weeks');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n public startOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('day');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n public endOfDay(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('day');\n\n return this;\n }\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public addDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n public subtractDays(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'days');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n public startOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('hour');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n public endOfHour(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('hour');\n\n return this;\n }\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public addHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n public subtractHours(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'hours');\n\n return this;\n }\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n public startOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).startOf('minute');\n\n return this;\n }\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n public endOfMinute(): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).endOf('minute');\n\n return this;\n }\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public addMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).add(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n public subtractMinutes(count?: number): DateApiObject<moment.Moment>\n {\n this._value = moment(this._value).subtract(count ?? 1, 'minutes');\n\n return this;\n }\n\n /**\n * Gets number of days in month\n */\n public daysInMonth(): number\n {\n return this._value.daysInMonth();\n }\n\n /**\n * Gets year\n */\n public year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n public year(year: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n public year(year?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(year))\n {\n this._value = moment(this._value).year(year);\n\n return this;\n }\n\n return this._value.year();\n }\n\n /**\n * Gets month\n */\n public month(): number\n /**\n * Sets month\n * @param month - Month to be set\n */\n public month(month: number): DateApiObject<moment.Moment>\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n public month(month?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(month))\n {\n this._value = moment(this._value).month(month);\n\n return this;\n }\n\n return this._value.month();\n }\n\n /**\n * Gets day of month one based\n */\n public dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n public dayOfMonth(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n public dayOfMonth(day?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).date(day);\n\n return this;\n }\n\n return this._value.date();\n }\n\n /**\n * Gets day of week zero based, first is monday\n */\n public dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n public dayOfWeek(day: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n public dayOfWeek(day?: number): number|DateApiObject<moment.Moment>\n {\n if(isPresent(day))\n {\n this._value = moment(this._value).weekday(day);\n\n return this;\n }\n\n return this._value.weekday();\n }\n\n /**\n * Gets hours zero based\n */\n public hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n public hour(hour: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n public hour(hour?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(hour))\n {\n this._value = moment(this._value).hours(hour);\n\n return this;\n }\n\n return this._value.hours();\n }\n\n /**\n * Gets minutes zero based\n */\n public minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n public minute(minute: number): DateApiObject<moment.Moment>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n public minute(minute?: number): DateApiObject<moment.Moment>|number\n {\n if(isPresent(minute))\n {\n this._value = moment(this._value).minutes(minute);\n\n return this;\n }\n\n return this._value.minutes();\n }\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n public isBefore(date: moment.Moment): boolean\n {\n return this._value.isBefore(date);\n }\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n public isAfter(date: moment.Moment): boolean\n {\n return this._value.isAfter(date);\n }\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n public diffDays(date: moment.Moment): number\n {\n return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');\n }\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n public isSameWeek(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'week');\n }\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n public isSameDecade(date: moment.Moment): boolean\n {\n const year = this._value.year();\n const start = year - (year % 10);\n const end = start + 10;\n\n return date.year() >= start && date.year() < end;\n }\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n public isSameYear(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'year');\n }\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n public isSameMonth(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'month');\n }\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n public isSameDay(date: moment.Moment): boolean\n {\n return this._value.isSame(date, 'day');\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._value));\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<moment.Moment>\n {\n return new MomentDateApiObject(moment(this._originalValue));\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: moment.Moment): DateApiObject<moment.Moment>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value!;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<moment.Moment>\n {\n this._value = this._originalValue;\n\n return this;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<MomentDateApiObject, moment.Moment>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for moment\n */\nexport const momentDateApiObjectType: DateApiObjectCtor<MomentDateApiObject, moment.Moment> = MomentDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for moment\n */\nexport const MOMENT_DATE_API_OBJECT_TYPE: ClassProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useClass: momentDateApiObjectType\n};\n"]}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FactoryProvider } from '@angular/core';
|
|
2
2
|
/**
|
|
3
3
|
* Injection token used for obtaining moment FormatProvider implementation
|
|
4
4
|
*/
|
|
5
5
|
export declare const MOMENT_FORMAT_PROVIDER: FactoryProvider;
|
|
6
|
-
/**
|
|
7
|
-
* Injection token used for injecting type that creates instance of DateApiObject for moment
|
|
8
|
-
*/
|
|
9
|
-
export declare const MOMENT_DATE_API_OBJECT_TYPE: ClassProvider;
|
|
10
6
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,eAAe,CAAC;AAG9C;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAsBpC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ClassProvider } from '@angular/core';
|
|
1
2
|
import { DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor } from '@anglr/datetime';
|
|
2
3
|
import moment from 'moment';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
@@ -336,4 +337,8 @@ export declare class MomentDateApi implements DateApi<moment.Moment> {
|
|
|
336
337
|
* Type that represents creation of DateApiObject for moment
|
|
337
338
|
*/
|
|
338
339
|
export declare const momentDateApiObjectType: DateApiObjectCtor<MomentDateApiObject, moment.Moment>;
|
|
340
|
+
/**
|
|
341
|
+
* Injection token used for injecting type that creates instance of DateApiObject for moment
|
|
342
|
+
*/
|
|
343
|
+
export declare const MOMENT_DATE_API_OBJECT_TYPE: ClassProvider;
|
|
339
344
|
//# sourceMappingURL=momentDateApi.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"momentDateApi.service.d.ts","sourceRoot":"","sources":["momentDateApi.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"momentDateApi.service.d.ts","sourceRoot":"","sources":["momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAqB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAEnI,OAAO,MAA2B,MAAM,QAAQ,CAAC;;AAEjD;;GAEG;AACH,qBAAa,mBAAoB,YAAW,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IAIpE;;OAEG;IACH,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC,MA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