@anglr/datetime 4.0.0-beta.20220526110343 → 4.0.0-beta.20221014045146

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/changelog.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## Version 4.0.0 (2022-05-25)
3
+ ## Version 4.0.0 (2022-10-14)
4
+
5
+ ### Bug Fixes
6
+
7
+ - updated `DateValueProvider` service, now correctly returns start of day for format with day
4
8
 
5
9
  ### Features
6
10
 
@@ -23,6 +27,7 @@
23
27
 
24
28
  ### BREAKING CHANGES
25
29
 
30
+ - updated `DateConvertPipe` now returns `DateApiObject<TDate>` instead of `TDate`
26
31
  - updated `DateFnsDateApi` constructor has new parameter `DATE_API_OBJECT_TYPE`
27
32
  - renamed `DATEFNS_FORMAT_PROVIDER` to `DATE_FNS_FORMAT_PROVIDER`
28
33
 
@@ -18,7 +18,7 @@ export class DateConvertPipe {
18
18
  transform(value, parseFormat) {
19
19
  const dateObj = this._dateApi.getValue(value, parseFormat);
20
20
  if (dateObj.isValid()) {
21
- return dateObj.value;
21
+ return dateObj;
22
22
  }
23
23
  return null;
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dateConvert.pipe.js","sourceRoot":"","sources":["../../../src/pipes/dateConvert.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,eAAe;IAExB,kEAAkE;IAClE,YAAsC,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAE9D,CAAC;IAED,sGAAsG;IAEtG;;;;OAIG;IACI,SAAS,CAAC,KAAsB,EAAE,WAAoB;QAEzD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAE3D,IAAG,OAAO,CAAC,OAAO,EAAE,EACpB;YACI,OAAO,OAAO,CAAC,KAAK,CAAC;SACxB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;;4GAxBQ,eAAe,kBAGJ,QAAQ;0GAHnB,eAAe;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAC,IAAI,EAAE,aAAa,EAAC;;0BAIV,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Pipe, PipeTransform} from '@angular/core';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateValue} from '../services';\n\n/**\n * Pipe that is used for converting date\n */\n@Pipe({name: 'dateConvert'})\nexport class DateConvertPipe<TDate = any> implements PipeTransform\n{\n //######################### constructors #########################\n constructor(@Inject(DATE_API) private _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods - implementation of PipeTransform #########################\n\n /**\n * Transforms value into date object\n * @param value - value to be transformed\n * @param parseFormat - format used for parsing string date\n */\n public transform(value: TDate|DateValue, parseFormat?: string): TDate|null\n {\n const dateObj = this._dateApi.getValue(value, parseFormat);\n\n if(dateObj.isValid())\n {\n return dateObj.value;\n }\n\n return null;\n }\n}"]}
1
+ {"version":3,"file":"dateConvert.pipe.js","sourceRoot":"","sources":["../../../src/pipes/dateConvert.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,eAAe;IAExB,kEAAkE;IAClE,YAAsC,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAE9D,CAAC;IAED,sGAAsG;IAEtG;;;;OAIG;IACI,SAAS,CAAC,KAAsB,EAAE,WAAoB;QAEzD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAE3D,IAAG,OAAO,CAAC,OAAO,EAAE,EACpB;YACI,OAAO,OAAO,CAAC;SAClB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;;4GAxBQ,eAAe,kBAGJ,QAAQ;0GAHnB,eAAe;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAC,IAAI,EAAE,aAAa,EAAC;;0BAIV,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Pipe, PipeTransform} from '@angular/core';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateApiObject, DateValue} from '../services';\n\n/**\n * Pipe that is used for converting date\n */\n@Pipe({name: 'dateConvert'})\nexport class DateConvertPipe<TDate = any> implements PipeTransform\n{\n //######################### constructors #########################\n constructor(@Inject(DATE_API) private _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods - implementation of PipeTransform #########################\n\n /**\n * Transforms value into date object\n * @param value - value to be transformed\n * @param parseFormat - format used for parsing string date\n */\n public transform(value: TDate|DateValue, parseFormat?: string): DateApiObject<TDate>|null\n {\n const dateObj = this._dateApi.getValue(value, parseFormat);\n\n if(dateObj.isValid())\n {\n return dateObj;\n }\n\n return null;\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dateApi.interface.js","sourceRoot":"","sources":["../../../src/services/dateApi.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Date can be represented as formatted string, timestamp or javascript Date object\n */\nexport type DateValue = Date|string|number;\n\n/**\n * Definition of type, that is used for creating instance of DateApiObject\n */\nexport interface DateApiObjectCtor<TObject extends DateApiObject<TDate> = any, TDate = any>\n{\n new (value: TDate|DateValue, format?: string, ...additionalParams: any[]): TObject;\n}\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport interface DateApiObject<TDate = any>\n{\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n readonly originalValue: TDate;\n\n /**\n * Instance of date\n */\n readonly value: TDate;\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n isValid(): boolean;\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n isWeekend(): boolean;\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n format(format: string): string;\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n startOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n endOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n startOfYear(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n endOfYear(): DateApiObject<TDate>;\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 addYears(count?: number): DateApiObject<TDate>;\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 subtractYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n startOfMonth(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n endOfMonth(): DateApiObject<TDate>;\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 addMonths(count?: number): DateApiObject<TDate>;\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 subtractMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n startOfWeek(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n endOfWeek(): DateApiObject<TDate>;\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 addWeeks(count?: number): DateApiObject<TDate>;\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 subtractWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n startOfDay(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n endOfDay(): DateApiObject<TDate>;\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 addDays(count?: number): DateApiObject<TDate>;\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 subtractDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n startOfHour(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n endOfHour(): DateApiObject<TDate>;\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 addHours(count?: number): DateApiObject<TDate>;\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 subtractHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n startOfMinute(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n endOfMinute(): DateApiObject<TDate>;\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 addMinutes(count?: number): DateApiObject<TDate>;\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 subtractMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Gets number of days in month\n */\n daysInMonth(): number;\n\n /**\n * Gets year\n */\n year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n year(year: number): DateApiObject<TDate>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n year(year?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets month\n */\n month(): number;\n /**\n * Sets month\n * @param month - Month to be set\n */\n month(month: number): DateApiObject<TDate>;\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n month(month?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of month one based\n */\n dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n dayOfMonth(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n dayOfMonth(day?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of week zero based, first is monday\n */\n dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n dayOfWeek(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n dayOfWeek(day?: number): number|DateApiObject<TDate>;\n\n /**\n * Gets hours zero based\n */\n hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n hour(hour: number): DateApiObject<TDate>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n hour(hour?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets minutes zero based\n */\n minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n minute(minute: number): DateApiObject<TDate>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n minute(minute?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n isBefore(date: TDate): boolean;\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n isAfter(date: TDate): boolean;\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 diffDays(date: TDate): number;\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 isSameWeek(date: TDate): boolean;\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 isSameDecade(date: TDate): boolean;\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 isSameYear(date: TDate): boolean;\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 isSameMonth(date: TDate): boolean;\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 isSameDay(date: TDate): boolean;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n clone(): DateApiObject<TDate>;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n cloneOriginal(): DateApiObject<TDate>;\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 updateOriginal(value?: TDate): DateApiObject<TDate>;\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n resetOriginal(): DateApiObject<TDate>;\n}\n\n/**\n * Date api abstraction, used for obtaining DateApi wrapper object\n */\nexport interface DateApi<TDate = any, TDateApiObject extends DateApiObject<TDate> = any>\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 getValue(value: DateValue|TDate, format?: string): TDateApiObject;\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n now(): TDateApiObject;\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 getFormat(pseudoFormat: string): string;\n\n /**\n * Gets information\n */\n weekStartsOnMonday(): boolean;\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n weekdaysShort(): string[];\n\n /**\n * Tests whether is value TDate\n * @param value - Value to be tested whether is TDate\n */\n isDate(value: unknown): value is TDate;\n}"]}
1
+ {"version":3,"file":"dateApi.interface.js","sourceRoot":"","sources":["../../../src/services/dateApi.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Date can be represented as formatted string, timestamp or javascript Date object\n */\nexport type DateValue = Date|string|number;\n\n/**\n * Definition of type, that is used for creating instance of DateApiObject\n */\nexport interface DateApiObjectCtor<TObject extends DateApiObject<TDate> = any, TDate = any>\n{\n new (value: TDate|DateValue, format?: string, ...additionalParams: any[]): TObject;\n}\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport interface DateApiObject<TDate = any>\n{\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n readonly originalValue: TDate;\n\n /**\n * Instance of date\n */\n readonly value: TDate;\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n isValid(): boolean;\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n isWeekend(): boolean;\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n format(format: string): string;\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n startOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n endOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n startOfYear(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n endOfYear(): DateApiObject<TDate>;\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 addYears(count?: number): DateApiObject<TDate>;\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 subtractYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n startOfMonth(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n endOfMonth(): DateApiObject<TDate>;\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 addMonths(count?: number): DateApiObject<TDate>;\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 subtractMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n startOfWeek(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n endOfWeek(): DateApiObject<TDate>;\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 addWeeks(count?: number): DateApiObject<TDate>;\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 subtractWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n startOfDay(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n endOfDay(): DateApiObject<TDate>;\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 addDays(count?: number): DateApiObject<TDate>;\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 subtractDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n startOfHour(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n endOfHour(): DateApiObject<TDate>;\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 addHours(count?: number): DateApiObject<TDate>;\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 subtractHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n startOfMinute(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n endOfMinute(): DateApiObject<TDate>;\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 addMinutes(count?: number): DateApiObject<TDate>;\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 subtractMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Gets number of days in month\n */\n daysInMonth(): number;\n\n /**\n * Gets year\n */\n year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n year(year: number): DateApiObject<TDate>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n year(year?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets month\n */\n month(): number;\n /**\n * Sets month\n * @param month - Month to be set\n */\n month(month: number): DateApiObject<TDate>;\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n month(month?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of month one based\n */\n dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n dayOfMonth(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n dayOfMonth(day?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of week zero based, first is monday\n */\n dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n dayOfWeek(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n dayOfWeek(day?: number): number|DateApiObject<TDate>;\n\n /**\n * Gets hours zero based\n */\n hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n hour(hour: number): DateApiObject<TDate>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n hour(hour?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets minutes zero based\n */\n minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n minute(minute: number): DateApiObject<TDate>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n minute(minute?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n isBefore(date: TDate): boolean;\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n isAfter(date: TDate): boolean;\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 diffDays(date: TDate): number;\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 isSameWeek(date: TDate): boolean;\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 isSameDecade(date: TDate): boolean;\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 isSameYear(date: TDate): boolean;\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 isSameMonth(date: TDate): boolean;\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 isSameDay(date: TDate): boolean;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n clone(): DateApiObject<TDate>;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n cloneOriginal(): DateApiObject<TDate>;\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 updateOriginal(value?: TDate): DateApiObject<TDate>;\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n resetOriginal(): DateApiObject<TDate>;\n}\n\n/**\n * Date api abstraction, used for obtaining DateApi wrapper object\n */\nexport interface DateApi<TDate = any, TDateApiObject extends DateApiObject<TDate> = DateApiObject<TDate>>\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 getValue(value: DateValue|TDate, format?: string): TDateApiObject;\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n now(): TDateApiObject;\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 getFormat(pseudoFormat: string): string;\n\n /**\n * Gets information\n */\n weekStartsOnMonday(): boolean;\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n weekdaysShort(): string[];\n\n /**\n * Tests whether is value TDate\n * @param value - Value to be tested whether is TDate\n */\n isDate(value: unknown): value is TDate;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeRelativeParser.service.js","sourceRoot":"","sources":["../../../src/services/dateTimeRelativeParser.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAS/B,iEAAiE;IACjE,YAAsB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;IAEzC,CAAC;IAED,oEAAoE;IAEpE;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,KAAsB;;QAE/B,MAAM,KAAK,GAAG,6BAA6B,CAAC;QAE5C,wBAAwB;QACxB,IAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACvC;YACI,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClC,MAAM,SAAS,GAAG,OAAQ,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,MAAM,GAAG,OAAQ,CAAC,CAAC,CAAC,CAAC;YAC3B,MAAM,MAAM,GAAG,OAAQ,CAAC,CAAC,CAAC,CAAC;YAC3B,IAAI,CAAC,QAAQ,GAAG,MAAA,IAAI,CA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,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAEhG,MAAM;qBACT;gBACD,KAAK,GAAG;oBACR;wBACI,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAE9F,MAAM;qBACT;aACJ;YAED,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SACrB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;;mHAtFQ,sBAAsB;uHAAtB,sBAAsB,cADV,MAAM;2FAClB,sBAAsB;kBADlC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC","sourcesContent":["import {Injectable, Injector} from '@angular/core';\nimport {isString} from '@jscrpt/common';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateValue} from './dateApi.interface';\n\n/**\n * Service used for parsing relative date time strings\n */\n@Injectable({providedIn: 'root'})\nexport class DateTimeRelativeParser<TDate = any>\n{\n //######################### protected fields #########################\n \n /**\n * Date api for handling\n */\n protected _dateApi?: DateApi<TDate>;\n\n //######################### constructor #########################\n constructor(protected _injector: Injector)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Tries to parse relative value and returns parsed TDate, otherwise returns input value\n * @param value - Value to be parsed\n * \n * @summary\n * i - for minutes\n * h - for hours\n * d - for days\n * w - for weeks\n * m - for months\n * y - for years\n */\n public parse(value: TDate|DateValue): TDate|DateValue\n {\n const regex = /([+-])\\s*(\\d+)\\s*([ihdwmy])/;\n\n //relative date provided\n if(isString(value) && regex.test(value))\n {\n const matches = regex.exec(value);\n const operation = matches![1];\n const amount = matches![2];\n const period = matches![3];\n this._dateApi = this._dateApi ?? this._injector.get(DATE_API);\n const now = this._dateApi.now();\n\n switch(period)\n {\n case 'i':\n {\n operation == '+' ? now.addMinutes(+amount).endOfMinute() : now.subtractMinutes(+amount).startOfMinute();\n\n break;\n }\n case 'h':\n {\n operation == '+' ? now.addHours(+amount).endOfHour() : now.subtractHours(+amount).startOfHour();\n\n break;\n }\n case 'd':\n {\n operation == '+' ? now.addDays(+amount).endOfDay() : now.subtractDays(+amount).startOfDay();\n\n break;\n }\n case 'w':\n {\n operation == '+' ? now.addWeeks(+amount).endOfDay() : now.subtractWeeks(+amount).startOfDay();\n\n break;\n }\n case 'm':\n {\n operation == '+' ? now.addMonths(+amount).endOfDay() : now.subtractMonths(+amount).startOfDay();\n\n break;\n }\n case 'y':\n {\n operation == '+' ? now.addYears(+amount).endOfDay() : now.subtractYears(+amount).startOfDay();\n\n break;\n }\n }\n\n value = now.value;\n }\n\n return value;\n }\n}"]}
1
+ {"version":3,"file":"dateTimeRelativeParser.service.js","sourceRoot":"","sources":["../../../src/services/dateTimeRelativeParser.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAS/B,iEAAiE;IACjE,YAAsB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;IAEzC,CAAC;IAED,oEAAoE;IAEpE;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,KAAsB;;QAE/B,MAAM,KAAK,GAAG,6BAA6B,CAAC;QAE5C,wBAAwB;QACxB,IAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACvC;YACI,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClC,MAAM,SAAS,GAAG,OAAQ,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,MAAM,GAAG,O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,KAAK,GAAG;oBACR;wBACI,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAEhG,MAAM;qBACT;gBACD,KAAK,GAAG;oBACR;wBACI,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAE9F,MAAM;qBACT;aACJ;YAED,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SACrB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;;mHAtFQ,sBAAsB;uHAAtB,sBAAsB,cADV,MAAM;2FAClB,sBAAsB;kBADlC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC","sourcesContent":["import {Injectable, Injector} from '@angular/core';\nimport {isString} from '@jscrpt/common';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateApiObject, DateValue} from './dateApi.interface';\n\n/**\n * Service used for parsing relative date time strings\n */\n@Injectable({providedIn: 'root'})\nexport class DateTimeRelativeParser<TDate = any>\n{\n //######################### protected fields #########################\n \n /**\n * Date api for handling\n */\n protected _dateApi?: DateApi<TDate, DateApiObject>;\n\n //######################### constructor #########################\n constructor(protected _injector: Injector)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Tries to parse relative value and returns parsed TDate, otherwise returns input value\n * @param value - Value to be parsed\n * \n * @summary\n * i - for minutes\n * h - for hours\n * d - for days\n * w - for weeks\n * m - for months\n * y - for years\n */\n public parse(value: TDate|DateValue): TDate|DateValue\n {\n const regex = /([+-])\\s*(\\d+)\\s*([ihdwmy])/;\n\n //relative date provided\n if(isString(value) && regex.test(value))\n {\n const matches = regex.exec(value);\n const operation = matches![1];\n const amount = matches![2];\n const period = matches![3];\n this._dateApi = this._dateApi ?? this._injector.get(DATE_API);\n const now = this._dateApi.now();\n\n switch(period)\n {\n case 'i':\n {\n operation == '+' ? now.addMinutes(+amount).endOfMinute() : now.subtractMinutes(+amount).startOfMinute();\n\n break;\n }\n case 'h':\n {\n operation == '+' ? now.addHours(+amount).endOfHour() : now.subtractHours(+amount).startOfHour();\n\n break;\n }\n case 'd':\n {\n operation == '+' ? now.addDays(+amount).endOfDay() : now.subtractDays(+amount).startOfDay();\n\n break;\n }\n case 'w':\n {\n operation == '+' ? now.addWeeks(+amount).endOfDay() : now.subtractWeeks(+amount).startOfDay();\n\n break;\n }\n case 'm':\n {\n operation == '+' ? now.addMonths(+amount).endOfDay() : now.subtractMonths(+amount).startOfDay();\n\n break;\n }\n case 'y':\n {\n operation == '+' ? now.addYears(+amount).endOfDay() : now.subtractYears(+amount).startOfDay();\n\n break;\n }\n }\n\n value = now.value;\n }\n\n return value;\n }\n}"]}
@@ -30,6 +30,11 @@ export class DateValueProvider {
30
30
  start = val.startOfHour().value;
31
31
  end = val.endOfHour().value;
32
32
  }
33
+ //day
34
+ else if (fullFormat.indexOf('d') >= 0) {
35
+ start = val.startOfDay().value;
36
+ end = val.endOfDay().value;
37
+ }
33
38
  //week
34
39
  else if (fullFormat.indexOf('w') >= 0) {
35
40
  start = val.startOfWeek().value;
@@ -1 +1 @@
1
- {"version":3,"file":"dateValueProvider.service.js","sourceRoot":"","sources":["../../../src/services/dateValueProvider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,iBAAiB;IAE1B,iEAAiE;IACjE,YAAwC,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAEhE,CAAC;IAED,o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,CAAC,EACpE;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QAED,OAAO;YACH,IAAI,EAAE,KAAK;YACX,EAAE,EAAE,GAAG;SACV,CAAC;IACN,CAAC;;8GAxDQ,iBAAiB,kBAGN,QAAQ;kHAHnB,iBAAiB,cADL,MAAM;2FAClB,iBAAiB;kBAD7B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;0BAIf,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Injectable} from '@angular/core';\n\nimport {DateTimeValue} from '../misc/datetime.interface';\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi} from './dateApi.interface';\n\n/**\n * Class used for obtaining DateTimeValue for various formats\n */\n@Injectable({providedIn: 'root'})\nexport class DateValueProvider<TDate = any>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets DateTimeValue from single value based on format\n * @param value - Current value to be converted to ranged value\n * @param format - Format that is requested to be displayed, it tells what range should be created\n */\n public getValue(value: TDate, format: string): DateTimeValue<TDate>\n {\n const val = this._dateApi.getValue(value, format);\n const fullFormat = this._dateApi.getFormat(format);\n let start: TDate = value;\n let end: TDate = value;\n\n //minute\n if(fullFormat.indexOf('m') >= 0)\n {\n start = val.startOfMinute().value;\n end = val.endOfMinute().value;\n }\n //hour\n else if(fullFormat.indexOf('H') >= 0)\n {\n start = val.startOfHour().value;\n end = val.endOfHour().value;\n }\n //week\n else if(fullFormat.indexOf('w') >= 0)\n {\n start = val.startOfWeek().value;\n end = val.endOfWeek().value;\n }\n //month\n else if(fullFormat.indexOf('M') >= 0)\n {\n start = val.startOfMonth().value;\n end = val.endOfMonth().value;\n }\n //year\n else if(fullFormat.indexOf('Y') >= 0 || fullFormat.indexOf('y') >= 0)\n {\n start = val.startOfYear().value;\n end = val.endOfYear().value;\n }\n\n return {\n from: start,\n to: end\n };\n }\n}"]}
1
+ {"version":3,"file":"dateValueProvider.service.js","sourceRoot":"","sources":["../../../src/services/dateValueProvider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,iBAAiB;IAE1B,iEAAiE;IACjE,YAAwC,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAEhE,CAAC;IAED,oEAAoE;IAEpE;;;;OAIG;IACI,QAAQ,CAAC,KAAY,EAAE,MAAc;QAExC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAClD,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,KAAK,GAAU,KAAK,CAAC;QACzB,IAAI,GAAG,GAAU,KAAK,CAAC;QAEvB,QAAQ;QACR,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAC/B;YACI,KAAK,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC;YAClC,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;SACjC;QACD,MAAM;aACD,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QACD,KAAK;aACA,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;YAC/B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;SAC9B;QACD,MAAM;aACD,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QACD,OAAO;aACF,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC;YACjC,GAAG,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;SAChC;QACD,MAAM;aACD,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpE;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QAED,OAAO;YACH,IAAI,EAAE,KAAK;YACX,EAAE,EAAE,GAAG;SACV,CAAC;IACN,CAAC;;8GA9DQ,iBAAiB,kBAGN,QAAQ;kHAHnB,iBAAiB,cADL,MAAM;2FAClB,iBAAiB;kBAD7B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;0BAIf,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Injectable} from '@angular/core';\n\nimport {DateTimeValue} from '../misc/datetime.interface';\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi} from './dateApi.interface';\n\n/**\n * Class used for obtaining DateTimeValue for various formats\n */\n@Injectable({providedIn: 'root'})\nexport class DateValueProvider<TDate = any>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets DateTimeValue from single value based on format\n * @param value - Current value to be converted to ranged value\n * @param format - Format that is requested to be displayed, it tells what range should be created\n */\n public getValue(value: TDate, format: string): DateTimeValue<TDate>\n {\n const val = this._dateApi.getValue(value, format);\n const fullFormat = this._dateApi.getFormat(format);\n let start: TDate = value;\n let end: TDate = value;\n\n //minute\n if(fullFormat.indexOf('m') >= 0)\n {\n start = val.startOfMinute().value;\n end = val.endOfMinute().value;\n }\n //hour\n else if(fullFormat.indexOf('H') >= 0)\n {\n start = val.startOfHour().value;\n end = val.endOfHour().value;\n }\n //day\n else if(fullFormat.indexOf('d') >= 0)\n {\n start = val.startOfDay().value;\n end = val.endOfDay().value;\n }\n //week\n else if(fullFormat.indexOf('w') >= 0)\n {\n start = val.startOfWeek().value;\n end = val.endOfWeek().value;\n }\n //month\n else if(fullFormat.indexOf('M') >= 0)\n {\n start = val.startOfMonth().value;\n end = val.endOfMonth().value;\n }\n //year\n else if(fullFormat.indexOf('Y') >= 0 || fullFormat.indexOf('y') >= 0)\n {\n start = val.startOfYear().value;\n end = val.endOfYear().value;\n }\n\n return {\n from: start,\n to: end\n };\n }\n}"]}
@@ -18,7 +18,7 @@ export class DateConvertPipe {
18
18
  transform(value, parseFormat) {
19
19
  const dateObj = this._dateApi.getValue(value, parseFormat);
20
20
  if (dateObj.isValid()) {
21
- return dateObj.value;
21
+ return dateObj;
22
22
  }
23
23
  return null;
24
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dateConvert.pipe.js","sourceRoot":"","sources":["../../../src/pipes/dateConvert.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,eAAe;IAExB,kEAAkE;IAClE,YAAsC,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAE9D,CAAC;IAED,sGAAsG;IAEtG;;;;OAIG;IACI,SAAS,CAAC,KAAsB,EAAE,WAAoB;QAEzD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAE3D,IAAG,OAAO,CAAC,OAAO,EAAE,EACpB;YACI,OAAO,OAAO,CAAC,KAAK,CAAC;SACxB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;;4GAxBQ,eAAe,kBAGJ,QAAQ;0GAHnB,eAAe;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAC,IAAI,EAAE,aAAa,EAAC;;0BAIV,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Pipe, PipeTransform} from '@angular/core';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateValue} from '../services';\n\n/**\n * Pipe that is used for converting date\n */\n@Pipe({name: 'dateConvert'})\nexport class DateConvertPipe<TDate = any> implements PipeTransform\n{\n //######################### constructors #########################\n constructor(@Inject(DATE_API) private _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods - implementation of PipeTransform #########################\n\n /**\n * Transforms value into date object\n * @param value - value to be transformed\n * @param parseFormat - format used for parsing string date\n */\n public transform(value: TDate|DateValue, parseFormat?: string): TDate|null\n {\n const dateObj = this._dateApi.getValue(value, parseFormat);\n\n if(dateObj.isValid())\n {\n return dateObj.value;\n }\n\n return null;\n }\n}"]}
1
+ {"version":3,"file":"dateConvert.pipe.js","sourceRoot":"","sources":["../../../src/pipes/dateConvert.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,eAAe;IAExB,kEAAkE;IAClE,YAAsC,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAE9D,CAAC;IAED,sGAAsG;IAEtG;;;;OAIG;IACI,SAAS,CAAC,KAAsB,EAAE,WAAoB;QAEzD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAE3D,IAAG,OAAO,CAAC,OAAO,EAAE,EACpB;YACI,OAAO,OAAO,CAAC;SAClB;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;;4GAxBQ,eAAe,kBAGJ,QAAQ;0GAHnB,eAAe;2FAAf,eAAe;kBAD3B,IAAI;mBAAC,EAAC,IAAI,EAAE,aAAa,EAAC;;0BAIV,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Pipe, PipeTransform} from '@angular/core';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateApiObject, DateValue} from '../services';\n\n/**\n * Pipe that is used for converting date\n */\n@Pipe({name: 'dateConvert'})\nexport class DateConvertPipe<TDate = any> implements PipeTransform\n{\n //######################### constructors #########################\n constructor(@Inject(DATE_API) private _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods - implementation of PipeTransform #########################\n\n /**\n * Transforms value into date object\n * @param value - value to be transformed\n * @param parseFormat - format used for parsing string date\n */\n public transform(value: TDate|DateValue, parseFormat?: string): DateApiObject<TDate>|null\n {\n const dateObj = this._dateApi.getValue(value, parseFormat);\n\n if(dateObj.isValid())\n {\n return dateObj;\n }\n\n return null;\n }\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dateApi.interface.js","sourceRoot":"","sources":["../../../src/services/dateApi.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Date can be represented as formatted string, timestamp or javascript Date object\n */\nexport type DateValue = Date|string|number;\n\n/**\n * Definition of type, that is used for creating instance of DateApiObject\n */\nexport interface DateApiObjectCtor<TObject extends DateApiObject<TDate> = any, TDate = any>\n{\n new (value: TDate|DateValue, format?: string, ...additionalParams: any[]): TObject;\n}\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport interface DateApiObject<TDate = any>\n{\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n readonly originalValue: TDate;\n\n /**\n * Instance of date\n */\n readonly value: TDate;\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n isValid(): boolean;\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n isWeekend(): boolean;\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n format(format: string): string;\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n startOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n endOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n startOfYear(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n endOfYear(): DateApiObject<TDate>;\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 addYears(count?: number): DateApiObject<TDate>;\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 subtractYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n startOfMonth(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n endOfMonth(): DateApiObject<TDate>;\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 addMonths(count?: number): DateApiObject<TDate>;\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 subtractMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n startOfWeek(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n endOfWeek(): DateApiObject<TDate>;\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 addWeeks(count?: number): DateApiObject<TDate>;\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 subtractWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n startOfDay(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n endOfDay(): DateApiObject<TDate>;\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 addDays(count?: number): DateApiObject<TDate>;\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 subtractDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n startOfHour(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n endOfHour(): DateApiObject<TDate>;\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 addHours(count?: number): DateApiObject<TDate>;\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 subtractHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n startOfMinute(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n endOfMinute(): DateApiObject<TDate>;\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 addMinutes(count?: number): DateApiObject<TDate>;\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 subtractMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Gets number of days in month\n */\n daysInMonth(): number;\n\n /**\n * Gets year\n */\n year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n year(year: number): DateApiObject<TDate>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n year(year?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets month\n */\n month(): number;\n /**\n * Sets month\n * @param month - Month to be set\n */\n month(month: number): DateApiObject<TDate>;\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n month(month?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of month one based\n */\n dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n dayOfMonth(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n dayOfMonth(day?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of week zero based, first is monday\n */\n dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n dayOfWeek(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n dayOfWeek(day?: number): number|DateApiObject<TDate>;\n\n /**\n * Gets hours zero based\n */\n hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n hour(hour: number): DateApiObject<TDate>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n hour(hour?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets minutes zero based\n */\n minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n minute(minute: number): DateApiObject<TDate>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n minute(minute?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n isBefore(date: TDate): boolean;\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n isAfter(date: TDate): boolean;\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 diffDays(date: TDate): number;\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 isSameWeek(date: TDate): boolean;\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 isSameDecade(date: TDate): boolean;\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 isSameYear(date: TDate): boolean;\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 isSameMonth(date: TDate): boolean;\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 isSameDay(date: TDate): boolean;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n clone(): DateApiObject<TDate>;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n cloneOriginal(): DateApiObject<TDate>;\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 updateOriginal(value?: TDate): DateApiObject<TDate>;\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n resetOriginal(): DateApiObject<TDate>;\n}\n\n/**\n * Date api abstraction, used for obtaining DateApi wrapper object\n */\nexport interface DateApi<TDate = any, TDateApiObject extends DateApiObject<TDate> = any>\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 getValue(value: DateValue|TDate, format?: string): TDateApiObject;\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n now(): TDateApiObject;\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 getFormat(pseudoFormat: string): string;\n\n /**\n * Gets information\n */\n weekStartsOnMonday(): boolean;\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n weekdaysShort(): string[];\n\n /**\n * Tests whether is value TDate\n * @param value - Value to be tested whether is TDate\n */\n isDate(value: unknown): value is TDate;\n}"]}
1
+ {"version":3,"file":"dateApi.interface.js","sourceRoot":"","sources":["../../../src/services/dateApi.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Date can be represented as formatted string, timestamp or javascript Date object\n */\nexport type DateValue = Date|string|number;\n\n/**\n * Definition of type, that is used for creating instance of DateApiObject\n */\nexport interface DateApiObjectCtor<TObject extends DateApiObject<TDate> = any, TDate = any>\n{\n new (value: TDate|DateValue, format?: string, ...additionalParams: any[]): TObject;\n}\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport interface DateApiObject<TDate = any>\n{\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n readonly originalValue: TDate;\n\n /**\n * Instance of date\n */\n readonly value: TDate;\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n isValid(): boolean;\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n isWeekend(): boolean;\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n format(format: string): string;\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n startOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n endOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n startOfYear(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n endOfYear(): DateApiObject<TDate>;\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 addYears(count?: number): DateApiObject<TDate>;\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 subtractYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n startOfMonth(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n endOfMonth(): DateApiObject<TDate>;\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 addMonths(count?: number): DateApiObject<TDate>;\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 subtractMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n startOfWeek(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n endOfWeek(): DateApiObject<TDate>;\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 addWeeks(count?: number): DateApiObject<TDate>;\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 subtractWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n startOfDay(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n endOfDay(): DateApiObject<TDate>;\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 addDays(count?: number): DateApiObject<TDate>;\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 subtractDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n startOfHour(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n endOfHour(): DateApiObject<TDate>;\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 addHours(count?: number): DateApiObject<TDate>;\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 subtractHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n startOfMinute(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n endOfMinute(): DateApiObject<TDate>;\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 addMinutes(count?: number): DateApiObject<TDate>;\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 subtractMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Gets number of days in month\n */\n daysInMonth(): number;\n\n /**\n * Gets year\n */\n year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n year(year: number): DateApiObject<TDate>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n year(year?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets month\n */\n month(): number;\n /**\n * Sets month\n * @param month - Month to be set\n */\n month(month: number): DateApiObject<TDate>;\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n month(month?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of month one based\n */\n dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n dayOfMonth(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n dayOfMonth(day?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of week zero based, first is monday\n */\n dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n dayOfWeek(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n dayOfWeek(day?: number): number|DateApiObject<TDate>;\n\n /**\n * Gets hours zero based\n */\n hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n hour(hour: number): DateApiObject<TDate>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n hour(hour?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets minutes zero based\n */\n minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n minute(minute: number): DateApiObject<TDate>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n minute(minute?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n isBefore(date: TDate): boolean;\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n isAfter(date: TDate): boolean;\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 diffDays(date: TDate): number;\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 isSameWeek(date: TDate): boolean;\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 isSameDecade(date: TDate): boolean;\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 isSameYear(date: TDate): boolean;\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 isSameMonth(date: TDate): boolean;\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 isSameDay(date: TDate): boolean;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n clone(): DateApiObject<TDate>;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n cloneOriginal(): DateApiObject<TDate>;\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 updateOriginal(value?: TDate): DateApiObject<TDate>;\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n resetOriginal(): DateApiObject<TDate>;\n}\n\n/**\n * Date api abstraction, used for obtaining DateApi wrapper object\n */\nexport interface DateApi<TDate = any, TDateApiObject extends DateApiObject<TDate> = DateApiObject<TDate>>\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 getValue(value: DateValue|TDate, format?: string): TDateApiObject;\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n now(): TDateApiObject;\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 getFormat(pseudoFormat: string): string;\n\n /**\n * Gets information\n */\n weekStartsOnMonday(): boolean;\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n weekdaysShort(): string[];\n\n /**\n * Tests whether is value TDate\n * @param value - Value to be tested whether is TDate\n */\n isDate(value: unknown): value is TDate;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeRelativeParser.service.js","sourceRoot":"","sources":["../../../src/services/dateTimeRelativeParser.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAS/B,iEAAiE;IACjE,YAAsB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;IAEzC,CAAC;IAED,oEAAoE;IAEpE;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,KAAsB;QAE/B,MAAM,KAAK,GAAG,6BAA6B,CAAC;QAE5C,wBAAwB;QACxB,IAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACvC;YACI,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClC,MAAM,SAAS,GAAG,OAAQ,CAAC,CA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AE,CAAC;wBAE9F,MAAM;qBACT;gBACD,KAAK,GAAG;oBACR;wBACI,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAEhG,MAAM;qBACT;gBACD,KAAK,GAAG;oBACR;wBACI,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAE9F,MAAM;qBACT;aACJ;YAED,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SACrB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;;mHAtFQ,sBAAsB;uHAAtB,sBAAsB,cADV,MAAM;2FAClB,sBAAsB;kBADlC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC","sourcesContent":["import {Injectable, Injector} from '@angular/core';\nimport {isString} from '@jscrpt/common';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateValue} from './dateApi.interface';\n\n/**\n * Service used for parsing relative date time strings\n */\n@Injectable({providedIn: 'root'})\nexport class DateTimeRelativeParser<TDate = any>\n{\n //######################### protected fields #########################\n \n /**\n * Date api for handling\n */\n protected _dateApi?: DateApi<TDate>;\n\n //######################### constructor #########################\n constructor(protected _injector: Injector)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Tries to parse relative value and returns parsed TDate, otherwise returns input value\n * @param value - Value to be parsed\n * \n * @summary\n * i - for minutes\n * h - for hours\n * d - for days\n * w - for weeks\n * m - for months\n * y - for years\n */\n public parse(value: TDate|DateValue): TDate|DateValue\n {\n const regex = /([+-])\\s*(\\d+)\\s*([ihdwmy])/;\n\n //relative date provided\n if(isString(value) && regex.test(value))\n {\n const matches = regex.exec(value);\n const operation = matches![1];\n const amount = matches![2];\n const period = matches![3];\n this._dateApi = this._dateApi ?? this._injector.get(DATE_API);\n const now = this._dateApi.now();\n\n switch(period)\n {\n case 'i':\n {\n operation == '+' ? now.addMinutes(+amount).endOfMinute() : now.subtractMinutes(+amount).startOfMinute();\n\n break;\n }\n case 'h':\n {\n operation == '+' ? now.addHours(+amount).endOfHour() : now.subtractHours(+amount).startOfHour();\n\n break;\n }\n case 'd':\n {\n operation == '+' ? now.addDays(+amount).endOfDay() : now.subtractDays(+amount).startOfDay();\n\n break;\n }\n case 'w':\n {\n operation == '+' ? now.addWeeks(+amount).endOfDay() : now.subtractWeeks(+amount).startOfDay();\n\n break;\n }\n case 'm':\n {\n operation == '+' ? now.addMonths(+amount).endOfDay() : now.subtractMonths(+amount).startOfDay();\n\n break;\n }\n case 'y':\n {\n operation == '+' ? now.addYears(+amount).endOfDay() : now.subtractYears(+amount).startOfDay();\n\n break;\n }\n }\n\n value = now.value;\n }\n\n return value;\n }\n}"]}
1
+ {"version":3,"file":"dateTimeRelativeParser.service.js","sourceRoot":"","sources":["../../../src/services/dateTimeRelativeParser.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,eAAe,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,sBAAsB;IAS/B,iEAAiE;IACjE,YAAsB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;IAEzC,CAAC;IAED,oEAAoE;IAEpE;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,KAAsB;QAE/B,MAAM,KAAK,GAAG,6BAA6B,CAAC;QAE5C,wBAAwB;QACxB,IAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,CAA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QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAE9F,MAAM;qBACT;gBACD,KAAK,GAAG;oBACR;wBACI,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAEhG,MAAM;qBACT;gBACD,KAAK,GAAG;oBACR;wBACI,SAAS,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;wBAE9F,MAAM;qBACT;aACJ;YAED,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;SACrB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;;mHAtFQ,sBAAsB;uHAAtB,sBAAsB,cADV,MAAM;2FAClB,sBAAsB;kBADlC,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC","sourcesContent":["import {Injectable, Injector} from '@angular/core';\nimport {isString} from '@jscrpt/common';\n\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi, DateApiObject, DateValue} from './dateApi.interface';\n\n/**\n * Service used for parsing relative date time strings\n */\n@Injectable({providedIn: 'root'})\nexport class DateTimeRelativeParser<TDate = any>\n{\n //######################### protected fields #########################\n \n /**\n * Date api for handling\n */\n protected _dateApi?: DateApi<TDate, DateApiObject>;\n\n //######################### constructor #########################\n constructor(protected _injector: Injector)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Tries to parse relative value and returns parsed TDate, otherwise returns input value\n * @param value - Value to be parsed\n * \n * @summary\n * i - for minutes\n * h - for hours\n * d - for days\n * w - for weeks\n * m - for months\n * y - for years\n */\n public parse(value: TDate|DateValue): TDate|DateValue\n {\n const regex = /([+-])\\s*(\\d+)\\s*([ihdwmy])/;\n\n //relative date provided\n if(isString(value) && regex.test(value))\n {\n const matches = regex.exec(value);\n const operation = matches![1];\n const amount = matches![2];\n const period = matches![3];\n this._dateApi = this._dateApi ?? this._injector.get(DATE_API);\n const now = this._dateApi.now();\n\n switch(period)\n {\n case 'i':\n {\n operation == '+' ? now.addMinutes(+amount).endOfMinute() : now.subtractMinutes(+amount).startOfMinute();\n\n break;\n }\n case 'h':\n {\n operation == '+' ? now.addHours(+amount).endOfHour() : now.subtractHours(+amount).startOfHour();\n\n break;\n }\n case 'd':\n {\n operation == '+' ? now.addDays(+amount).endOfDay() : now.subtractDays(+amount).startOfDay();\n\n break;\n }\n case 'w':\n {\n operation == '+' ? now.addWeeks(+amount).endOfDay() : now.subtractWeeks(+amount).startOfDay();\n\n break;\n }\n case 'm':\n {\n operation == '+' ? now.addMonths(+amount).endOfDay() : now.subtractMonths(+amount).startOfDay();\n\n break;\n }\n case 'y':\n {\n operation == '+' ? now.addYears(+amount).endOfDay() : now.subtractYears(+amount).startOfDay();\n\n break;\n }\n }\n\n value = now.value;\n }\n\n return value;\n }\n}"]}
@@ -30,6 +30,11 @@ export class DateValueProvider {
30
30
  start = val.startOfHour().value;
31
31
  end = val.endOfHour().value;
32
32
  }
33
+ //day
34
+ else if (fullFormat.indexOf('d') >= 0) {
35
+ start = val.startOfDay().value;
36
+ end = val.endOfDay().value;
37
+ }
33
38
  //week
34
39
  else if (fullFormat.indexOf('w') >= 0) {
35
40
  start = val.startOfWeek().value;
@@ -1 +1 @@
1
- {"version":3,"file":"dateValueProvider.service.js","sourceRoot":"","sources":["../../../src/services/dateValueProvider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAAC,QAAQ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,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;SAChC;QACD,MAAM;aACD,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpE;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QAED,OAAO;YACH,IAAI,EAAE,KAAK;YACX,EAAE,EAAE,GAAG;SACV,CAAC;IACN,CAAC;;8GAxDQ,iBAAiB,kBAGN,QAAQ;kHAHnB,iBAAiB,cADL,MAAM;2FAClB,iBAAiB;kBAD7B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;0BAIf,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Injectable} from '@angular/core';\n\nimport {DateTimeValue} from '../misc/datetime.interface';\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi} from './dateApi.interface';\n\n/**\n * Class used for obtaining DateTimeValue for various formats\n */\n@Injectable({providedIn: 'root'})\nexport class DateValueProvider<TDate = any>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets DateTimeValue from single value based on format\n * @param value - Current value to be converted to ranged value\n * @param format - Format that is requested to be displayed, it tells what range should be created\n */\n public getValue(value: TDate, format: string): DateTimeValue<TDate>\n {\n const val = this._dateApi.getValue(value, format);\n const fullFormat = this._dateApi.getFormat(format);\n let start: TDate = value;\n let end: TDate = value;\n\n //minute\n if(fullFormat.indexOf('m') >= 0)\n {\n start = val.startOfMinute().value;\n end = val.endOfMinute().value;\n }\n //hour\n else if(fullFormat.indexOf('H') >= 0)\n {\n start = val.startOfHour().value;\n end = val.endOfHour().value;\n }\n //week\n else if(fullFormat.indexOf('w') >= 0)\n {\n start = val.startOfWeek().value;\n end = val.endOfWeek().value;\n }\n //month\n else if(fullFormat.indexOf('M') >= 0)\n {\n start = val.startOfMonth().value;\n end = val.endOfMonth().value;\n }\n //year\n else if(fullFormat.indexOf('Y') >= 0 || fullFormat.indexOf('y') >= 0)\n {\n start = val.startOfYear().value;\n end = val.endOfYear().value;\n }\n\n return {\n from: start,\n to: end\n };\n }\n}"]}
1
+ {"version":3,"file":"dateValueProvider.service.js","sourceRoot":"","sources":["../../../src/services/dateValueProvider.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;;AAGxC;;GAEG;AAEH,MAAM,OAAO,iBAAiB;IAE1B,iEAAiE;IACjE,YAAwC,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;IAEhE,CAAC;IAED,oEAAoE;IAEpE;;;;OAIG;IACI,QAAQ,CAAC,KAAY,EAAE,MAAc;QAExC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAClD,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACnD,IAAI,KAAK,GAAU,KAAK,CAAC;QACzB,IAAI,GAAG,GAAU,KAAK,CAAC;QAEvB,QAAQ;QACR,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAC/B;YACI,KAAK,GAAG,GAAG,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC;YAClC,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;SACjC;QACD,MAAM;aACD,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QACD,KAAK;aACA,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;YAC/B,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;SAC9B;QACD,MAAM;aACD,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QACD,OAAO;aACF,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpC;YACI,KAAK,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC;YACjC,GAAG,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC;SAChC;QACD,MAAM;aACD,IAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EACpE;YACI,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC;YAChC,GAAG,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC;SAC/B;QAED,OAAO;YACH,IAAI,EAAE,KAAK;YACX,EAAE,EAAE,GAAG;SACV,CAAC;IACN,CAAC;;8GA9DQ,iBAAiB,kBAGN,QAAQ;kHAHnB,iBAAiB,cADL,MAAM;2FAClB,iBAAiB;kBAD7B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;0BAIf,MAAM;2BAAC,QAAQ","sourcesContent":["import {Inject, Injectable} from '@angular/core';\n\nimport {DateTimeValue} from '../misc/datetime.interface';\nimport {DATE_API} from '../misc/tokens';\nimport {DateApi} from './dateApi.interface';\n\n/**\n * Class used for obtaining DateTimeValue for various formats\n */\n@Injectable({providedIn: 'root'})\nexport class DateValueProvider<TDate = any>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets DateTimeValue from single value based on format\n * @param value - Current value to be converted to ranged value\n * @param format - Format that is requested to be displayed, it tells what range should be created\n */\n public getValue(value: TDate, format: string): DateTimeValue<TDate>\n {\n const val = this._dateApi.getValue(value, format);\n const fullFormat = this._dateApi.getFormat(format);\n let start: TDate = value;\n let end: TDate = value;\n\n //minute\n if(fullFormat.indexOf('m') >= 0)\n {\n start = val.startOfMinute().value;\n end = val.endOfMinute().value;\n }\n //hour\n else if(fullFormat.indexOf('H') >= 0)\n {\n start = val.startOfHour().value;\n end = val.endOfHour().value;\n }\n //day\n else if(fullFormat.indexOf('d') >= 0)\n {\n start = val.startOfDay().value;\n end = val.endOfDay().value;\n }\n //week\n else if(fullFormat.indexOf('w') >= 0)\n {\n start = val.startOfWeek().value;\n end = val.endOfWeek().value;\n }\n //month\n else if(fullFormat.indexOf('M') >= 0)\n {\n start = val.startOfMonth().value;\n end = val.endOfMonth().value;\n }\n //year\n else if(fullFormat.indexOf('Y') >= 0 || fullFormat.indexOf('y') >= 0)\n {\n start = val.startOfYear().value;\n end = val.endOfYear().value;\n }\n\n return {\n from: start,\n to: end\n };\n }\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/datetime",
3
- "version": "4.0.0-beta.20220526110343",
3
+ "version": "4.0.0-beta.20221014045146",
4
4
  "description": "Angular library for datetime manipulation components",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,5 +1,5 @@
1
1
  import { PipeTransform } from '@angular/core';
2
- import { DateApi, DateValue } from '../services';
2
+ import { DateApi, DateApiObject, DateValue } from '../services';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Pipe that is used for converting date
@@ -12,7 +12,7 @@ export declare class DateConvertPipe<TDate = any> implements PipeTransform {
12
12
  * @param value - value to be transformed
13
13
  * @param parseFormat - format used for parsing string date
14
14
  */
15
- transform(value: TDate | DateValue, parseFormat?: string): TDate | null;
15
+ transform(value: TDate | DateValue, parseFormat?: string): DateApiObject<TDate> | null;
16
16
  static ɵfac: i0.ɵɵFactoryDeclaration<DateConvertPipe<any>, never>;
17
17
  static ɵpipe: i0.ɵɵPipeDeclaration<DateConvertPipe<any>, "dateConvert">;
18
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dateConvert.pipe.d.ts","sourceRoot":"","sources":["dateConvert.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAC,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;;AAE/C;;GAEG;AACH,qBACa,eAAe,CAAC,KAAK,GAAG,GAAG,CAAE,YAAW,aAAa;IAGhC,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;IAM9D;;;;OAIG;IACI,SAAS,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,GAAC,IAAI;yCAdjE,eAAe;uCAAf,eAAe;CAyB3B"}
1
+ {"version":3,"file":"dateConvert.pipe.d.ts","sourceRoot":"","sources":["dateConvert.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAC,MAAM,eAAe,CAAC;AAG1D,OAAO,EAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;;AAE9D;;GAEG;AACH,qBACa,eAAe,CAAC,KAAK,GAAG,GAAG,CAAE,YAAW,aAAa;IAGhC,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;IAM9D;;;;OAIG;IACI,SAAS,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,GAAC,IAAI;yCAdhF,eAAe;uCAAf,eAAe;CAyB3B"}
@@ -326,7 +326,7 @@ export interface DateApiObject<TDate = any> {
326
326
  /**
327
327
  * Date api abstraction, used for obtaining DateApi wrapper object
328
328
  */
329
- export interface DateApi<TDate = any, TDateApiObject extends DateApiObject<TDate> = any> {
329
+ export interface DateApi<TDate = any, TDateApiObject extends DateApiObject<TDate> = DateApiObject<TDate>> {
330
330
  /**
331
331
  * Gets wrapping object used for manipulation
332
332
  * @param value - Value to be converted (parsed) and used for manipulation
@@ -1 +1 @@
1
- {"version":3,"file":"dateApi.interface.d.ts","sourceRoot":"","sources":["dateApi.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS,GAAG,IAAI,GAAC,MAAM,GAAC,MAAM,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,aAAa,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,KAAK,GAAG,GAAG;IAEtF,KAAK,KAAK,EAAE,KAAK,GAAC,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;CACtF;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,GAAG;IAEtC;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC;IAErB;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B;;;OAGG;IACH,aAAa,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAEtC;;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AEpG;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAC,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;IAElE;;OAEG;IACH,GAAG,IAAI,cAAc,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAExC;;OAEG;IACH,kBAAkB,IAAI,OAAO,CAAC;IAE9B;;OAEG;IACH,aAAa,IAAI,MAAM,EAAE,CAAC;IAE1B;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAAC;CAC1C"}
@@ -1,5 +1,5 @@
1
1
  import { Injector } from '@angular/core';
2
- import { DateApi, DateValue } from './dateApi.interface';
2
+ import { DateApi, DateApiObject, DateValue } from './dateApi.interface';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Service used for parsing relative date time strings
@@ -9,7 +9,7 @@ export declare class DateTimeRelativeParser<TDate = any> {
9
9
  /**
10
10
  * Date api for handling
11
11
  */
12
- protected _dateApi?: DateApi<TDate>;
12
+ protected _dateApi?: DateApi<TDate, DateApiObject>;
13
13
  constructor(_injector: Injector);
14
14
  /**
15
15
  * Tries to parse relative value and returns parsed TDate, otherwise returns input value
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeRelativeParser.service.d.ts","sourceRoot":"","sources":["dateTimeRelativeParser.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAC,MAAM,eAAe,CAAC;AAInD,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;;AAEvD;;GAEG;AACH,qBACa,sBAAsB,CAAC,KAAK,GAAG,GAAG;IAU/B,SAAS,CAAC,SAAS,EAAE,QAAQ;IANzC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;gBAGd,SAAS,EAAE,QAAQ;IAMzC;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,GAAG,KAAK,GAAC,SAAS;yCA5B5C,sBAAsB;6CAAtB,sBAAsB;CAuFlC"}
1
+ {"version":3,"file":"dateTimeRelativeParser.service.d.ts","sourceRoot":"","sources":["dateTimeRelativeParser.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAC,MAAM,eAAe,CAAC;AAInD,OAAO,EAAC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAC,MAAM,qBAAqB,CAAC;;AAEtE;;GAEG;AACH,qBACa,sBAAsB,CAAC,KAAK,GAAG,GAAG;IAU/B,SAAS,CAAC,SAAS,EAAE,QAAQ;IANzC;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;gBAG7B,SAAS,EAAE,QAAQ;IAMzC;;;;;;;;;;;OAWG;IACI,KAAK,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,GAAG,KAAK,GAAC,SAAS;yCA5B5C,sBAAsB;6CAAtB,sBAAsB;CAuFlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"dateValueProvider.service.d.ts","sourceRoot":"","sources":["dateValueProvider.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;;AAE5C;;GAEG;AACH,qBACa,iBAAiB,CAAC,KAAK,GAAG,GAAG;IAGR,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;gBAAxB,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;IAMhE;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC;yCAd1D,iBAAiB;6CAAjB,iBAAiB;CAyD7B"}
1
+ {"version":3,"file":"dateValueProvider.service.d.ts","sourceRoot":"","sources":["dateValueProvider.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;;AAE5C;;GAEG;AACH,qBACa,iBAAiB,CAAC,KAAK,GAAG,GAAG;IAGR,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;gBAAxB,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC;IAMhE;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC;yCAd1D,iBAAiB;6CAAjB,iBAAiB;CA+D7B"}
package/version.bak CHANGED
@@ -1 +1 @@
1
- 4.0.0-beta.20220526110343
1
+ 4.0.0-beta.20221014045146