@anglr/datetime 3.0.0-beta.20220503131853 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/changelog.md +7 -2
  2. package/date-fns/src/services/dateFnsDateApi.service.d.ts +4 -0
  3. package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
  4. package/es2015/date-fns/src/services/dateFnsDateApi.service.js +7 -1
  5. package/es2015/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
  6. package/es2015/moment/src/services/momentDateApi.service.js +6 -0
  7. package/es2015/moment/src/services/momentDateApi.service.js.map +1 -1
  8. package/es2015/src/picker/components/dayPicker/dayPicker.component.js +8 -2
  9. package/es2015/src/picker/components/dayPicker/dayPicker.component.js.map +1 -1
  10. package/es2015/src/picker/components/pickerImplBase.component.js.map +1 -1
  11. package/es2015/src/picker/components/rollerTimePicker/rollerTimePicker.component.js +7 -3
  12. package/es2015/src/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
  13. package/es2015/src/picker/directives/loopScroll/loopScroll.directive.js +60 -8
  14. package/es2015/src/picker/directives/loopScroll/loopScroll.directive.js.map +1 -1
  15. package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js +4 -0
  16. package/es2015/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -1
  17. package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +4 -0
  18. package/es2015/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -1
  19. package/es2015/src/services/dateApi.interface.js.map +1 -1
  20. package/es2020/date-fns/src/services/dateFnsDateApi.service.js +7 -1
  21. package/es2020/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
  22. package/es2020/moment/src/services/momentDateApi.service.js +6 -0
  23. package/es2020/moment/src/services/momentDateApi.service.js.map +1 -1
  24. package/es2020/src/picker/components/dayPicker/dayPicker.component.js +8 -2
  25. package/es2020/src/picker/components/dayPicker/dayPicker.component.js.map +1 -1
  26. package/es2020/src/picker/components/pickerImplBase.component.js.map +1 -1
  27. package/es2020/src/picker/components/rollerTimePicker/rollerTimePicker.component.js +7 -3
  28. package/es2020/src/picker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
  29. package/es2020/src/picker/directives/loopScroll/loopScroll.directive.js +58 -6
  30. package/es2020/src/picker/directives/loopScroll/loopScroll.directive.js.map +1 -1
  31. package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js +4 -0
  32. package/es2020/src/selector/components/inputDateTime/inputDateTime.component.js.map +1 -1
  33. package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +4 -0
  34. package/es2020/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +1 -1
  35. package/es2020/src/services/dateApi.interface.js.map +1 -1
  36. package/moment/src/services/momentDateApi.service.d.ts +4 -0
  37. package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
  38. package/package.json +1 -1
  39. package/src/picker/components/dayPicker/dayPicker.component.d.ts +5 -0
  40. package/src/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  41. package/src/picker/components/dayPicker/dayPicker.component.html +1 -1
  42. package/src/picker/components/pickerImplBase.component.d.ts +1 -1
  43. package/src/picker/components/rollerTimePicker/rollerTimePicker.component.css +14 -2
  44. package/src/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts +1 -1
  45. package/src/picker/components/rollerTimePicker/rollerTimePicker.component.d.ts.map +1 -1
  46. package/src/picker/components/rollerTimePicker/rollerTimePicker.component.html +10 -4
  47. package/src/picker/directives/loopScroll/loopScroll.directive.d.ts +21 -2
  48. package/src/picker/directives/loopScroll/loopScroll.directive.d.ts.map +1 -1
  49. package/src/selector/components/inputDateTime/inputDateTime.component.d.ts.map +1 -1
  50. package/src/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts.map +1 -1
  51. package/src/services/dateApi.interface.d.ts +5 -0
  52. package/src/services/dateApi.interface.d.ts.map +1 -1
  53. package/version.bak +1 -1
package/changelog.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## Version 3.0.0 (2022-03-21)
3
+ ## Version 3.0.0 (2022-05-04)
4
4
 
5
5
  ### Bug Fixes
6
6
 
@@ -8,6 +8,7 @@
8
8
  - fixed placeholder value of `undefined`
9
9
  - fixed problem with occasionally error *cant access property length*
10
10
  - fixed not working setting *disabled* or *enabled* from code
11
+ - fixed problem with writing date manually into input
11
12
 
12
13
  ### Features
13
14
 
@@ -23,6 +24,8 @@
23
24
  - new `hour` method, that gets or sets hours zero based
24
25
  - new `minute` method, that gets or sets minutes zero based
25
26
  - `DateTimeRelativeParser` now supports *hours* and *minutes* as relative values
27
+ - updated `DateApi` interface
28
+ - new `isDate` method, that tests whether is value TDate
26
29
  - `FormatProvider` interface
27
30
  - new `year` property, that is format token for displaying full year
28
31
  - new `month` property, that is format token for displaying month double digit number
@@ -51,7 +54,7 @@
51
54
  - `selectorElement` selector element which is used during absolute positioning of picker
52
55
  - *outputs*
53
56
  - `valueChange` occurs when value changes
54
- - `DateTimeDayPickerComponent` component now supports scaling down to *dateTime*
57
+ - `DateTimeDayPickerComponent` component now supports scaling down to *time*
55
58
  - `CommonPickerCssClasses` interface
56
59
  - new `clickable` property, that is name of css class that represents clickable items in picker
57
60
  - new `DateTimeRollerTimePickerComponent` component used for rendering roller time picker
@@ -69,12 +72,14 @@
69
72
  - *selector* `"loopScrollData"`
70
73
  - *inputs*
71
74
  - `loopScrollData` data for loop
75
+ - `clone` indication that this node is clone
72
76
  - updated `InputDateTimeSelectorComponent` now supports *hours* and *minutes*
73
77
  - updated `DateValueProvider` now supports *hours* and *minutes*
74
78
  - *subpackage* `@anglr/datetime/moment`
75
79
  - updated `MomentDateApiObject` to correspond with `DateApiObject` interface
76
80
  - updated `MOMENT_FORMAT_PROVIDER` to correspond with `FormatProvider` interface
77
81
  - *subpackage* `@anglr/datetime/date-fns`
82
+ - updated `DateFnsDateApi` to correspond with `DateApi` interface
78
83
  - updated `DateFnsDateApiObject` to correspond with `DateApiObject` interface
79
84
  - updated `DATEFNS_FORMAT_PROVIDER` to correspond with `FormatProvider` interface
80
85
 
@@ -31,6 +31,10 @@ export declare class DateFnsDateApi implements DateApi<Date> {
31
31
  * Gets array of weekday names in short format, order of days is dependent on locale
32
32
  */
33
33
  weekdaysShort(): string[];
34
+ /**
35
+ * @inheritdoc
36
+ */
37
+ isDate(value: unknown): value is Date;
34
38
  static ɵfac: i0.ɵɵFactoryDeclaration<DateFnsDateApi, never>;
35
39
  static ɵprov: i0.ɵɵInjectableDeclaration<DateFnsDateApi>;
36
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dateFnsDateApi.service.d.ts","sourceRoot":"","sources":["dateFnsDateApi.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAK1F,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;;AA+pBtD;;GAEG;AACH,qBACa,cAAe,YAAW,OAAO,CAAC,IAAI,CAAC;IAGX,SAAS,CAAC,UAAU,EAAE,aAAa;IAC5D,SAAS,CAAC,eAAe,EAAE,sBAAsB,CAAC,IAAI,CAAC;gBADpB,UAAU,EAAE,aAAa,EAClD,eAAe,EAAE,sBAAsB,CAAC,IAAI,CAAC;IAMnE;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,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;yCAlFvB,cAAc;6CAAd,cAAc;CA8F1B"}
1
+ {"version":3,"file":"dateFnsDateApi.service.d.ts","sourceRoot":"","sources":["dateFnsDateApi.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAK1F,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAC;;AA+pBtD;;GAEG;AACH,qBACa,cAAe,YAAW,OAAO,CAAC,IAAI,CAAC;IAGX,SAAS,CAAC,UAAU,EAAE,aAAa;IAC5D,SAAS,CAAC,eAAe,EAAE,sBAAsB,CAAC,IAAI,CAAC;gBADpB,UAAU,EAAE,aAAa,EAClD,eAAe,EAAE,sBAAsB,CAAC,IAAI,CAAC;IAMnE;;;;OAIG;IACI,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,IAAI,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;yCAlGnC,cAAc;6CAAd,cAAc;CAsG1B"}
@@ -1,7 +1,7 @@
1
1
  import { Inject, Injectable } from '@angular/core';
2
2
  import { DateTimeRelativeParser } from '@anglr/datetime';
3
3
  import { isBlank, isPresent, isString } from '@jscrpt/common';
4
- import { 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 } from 'date-fns';
4
+ import { 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';
5
5
  import { DATE_FNS_LOCALE } from '../misc/tokens';
6
6
  import * as i0 from "@angular/core";
7
7
  import * as i1 from "@anglr/datetime";
@@ -520,6 +520,12 @@ export class DateFnsDateApi {
520
520
  }
521
521
  return weekdays;
522
522
  }
523
+ /**
524
+ * @inheritdoc
525
+ */
526
+ isDate(value) {
527
+ return isDate(value);
528
+ }
523
529
  }
524
530
  DateFnsDateApi.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateFnsDateApi, deps: [{ token: DATE_FNS_LOCALE }, { token: i1.DateTimeRelativeParser }], target: i0.ɵɵFactoryTarget.Injectable });
525
531
  DateFnsDateApi.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateFnsDateApi });
@@ -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,EAAC,MAAM,i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AC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;SAC3F;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;;2GA7FQ,cAAc,kBAGH,eAAe;+GAH1B,cAAc;2FAAd,cAAc;kBAD1B,UAAU;;0BAIM,MAAM;2BAAC,eAAe","sourcesContent":["import {Inject, Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser} 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} 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 */\nclass DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### private fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n private _originalValue: Date;\n\n /**\n * Instance of date\n */\n private _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 protected _localeSvc: DateFnsLocale,\n format?: string)\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), 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), 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 {\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 DateFnsDateApiObject(this._relativeParser.parse(value), this._localeSvc, format);\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 DateFnsDateApiObject(new Date(), 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}"]}
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,EAAC,MAAM,iBAAiB,CAAC;AAC1F,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,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, DateTimeRelativeParser} 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 */\nclass DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### private fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n private _originalValue: Date;\n\n /**\n * Instance of date\n */\n private _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 protected _localeSvc: DateFnsLocale,\n format?: string)\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), 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), 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 {\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 DateFnsDateApiObject(this._relativeParser.parse(value), this._localeSvc, format);\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 DateFnsDateApiObject(new Date(), 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}"]}
@@ -479,6 +479,12 @@ export class MomentDateApi {
479
479
  weekdaysShort() {
480
480
  return moment.weekdaysShort(true);
481
481
  }
482
+ /**
483
+ * @inheritdoc
484
+ */
485
+ isDate(value) {
486
+ return value instanceof moment;
487
+ }
482
488
  }
483
489
  MomentDateApi.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MomentDateApi, deps: [{ token: i1.DateTimeRelativeParser }], target: i0.ɵɵFactoryTarget.Injectable });
484
490
  MomentDateApi.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MomentDateApi });
@@ -1 +1 @@
1
- {"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAoC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAE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YAAsB,eAAsD;QAAtD,oBAAe,GAAf,eAAe,CAAuC;IAE5E,CAAC;IAED,oEAAoE;IAEpE;;;;OAIG;IACI,QAAQ,CAAC,KAA8B,EAAE,MAAe;QAE3D,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9E,CAAC;IAED;;OAEG;IACI,GAAG;QAEN,OAAO,IAAI,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,YAAoB;QAEjC,IAAG,yBAAyB,CAAC,IAAI,CAAC,YAAY,CAAC,EAC/C;YACI,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,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;;0GAvDQ,aAAa;8GAAb,aAAa;2FAAb,aAAa;kBADzB,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser} 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 */\nclass MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### private fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n private _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n private _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 {\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 MomentDateApiObject(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 MomentDateApiObject(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}"]}
1
+ {"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAoC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,mBAAmB;IAgCrB,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;I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AAoB;QAEjC,IAAG,yBAAyB,CAAC,IAAI,CAAC,YAAY,CAAC,EAC/C;YACI,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,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;;0GA/DQ,aAAa;8GAAb,aAAa;2FAAb,aAAa;kBADzB,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser} 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 */\nclass MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### private fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n private _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n private _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 {\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 MomentDateApiObject(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 MomentDateApiObject(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}"]}
@@ -40,6 +40,12 @@ export class DateTimeDayPickerComponent extends PickerBaseComponent {
40
40
  this.cssClasses = extend(true, {}, defaultStyles);
41
41
  this.weekdays = this._dateApi.weekdaysShort();
42
42
  }
43
+ /**
44
+ * Value used for displaying time
45
+ */
46
+ get timeValue() {
47
+ return this._value;
48
+ }
43
49
  //######################### public methods - template bindings #########################
44
50
  /**
45
51
  * Changes displayed period to "lower" period
@@ -197,10 +203,10 @@ export class DateTimeDayPickerComponent extends PickerBaseComponent {
197
203
  }
198
204
  }
199
205
  DateTimeDayPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, deps: [{ token: DATE_API }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
200
- DateTimeDayPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeDayPickerComponent, selector: "date-time-day-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{displayDate?.value | dateFormat: 'time'}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "asRequired": i2.AsRequiredTypePipe, "mergeCssClasses": i2.MergeCssClassesPipe, "dateFormat": i3.DateFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
206
+ DateTimeDayPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DateTimeDayPickerComponent, selector: "date-time-day-picker", usesInheritance: true, ngImport: i0, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "asRequired": i2.AsRequiredTypePipe, "mergeCssClasses": i2.MergeCssClassesPipe, "dateFormat": i3.DateFormatPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
201
207
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DateTimeDayPickerComponent, decorators: [{
202
208
  type: Component,
203
- args: [{ selector: 'date-time-day-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{displayDate?.value | dateFormat: 'time'}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"] }]
209
+ args: [{ selector: 'date-time-day-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>", styles: [".period-data\r\n{\r\n grid-template-columns: repeat(7, 1fr);\r\n}\r\n\r\n.weekday\r\n{\r\n text-align: center;\r\n font-weight: bold;\r\n opacity: 0.7;\r\n margin-bottom: 6px;\r\n}\r\n\r\n.period-datum:not(.other-month)\r\n{\r\n font-weight: bold;\r\n}\r\n\r\n.other-month\r\n{\r\n opacity: 0.5;\r\n}"] }]
204
210
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
205
211
  type: Inject,
206
212
  args: [DATE_API]
@@ -1 +1 @@
1
- {"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.component.ts","../../../../../src/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAC,mBAAmB,EAAC,MAAM,yBAAyB,CAAC;;;;;AAG5D;;GAEG;AACH,MAAM,aAAa,GACnB;IACI,eAAe,EAAE,QAAQ;IACzB,cAAc,EAAE,6BAA6B;IAC7C,UAAU,EAAE,8BAA8B;IAC1C,WAAW,EAAE,cAAc;IAC3B,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,WAAW;CACzB,CAAC;AAEF;;GAEG;AAQH,MAAM,OAAO,0BAAwC,SAAQ,mBAA+D;IAiBxH,iEAAiE;IACjE,YAA8B,OAAuB,EACzC,cAAiC;QAEzC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAnBnC,sEAAsE;QAEtE;;WAEG;QACO,mBAAc,GAAqB,EAAE,CAAC;QAEhD,2FAA2F;QAE3F;;;WAGG;QACI,aAAQ,GAAa,EAAE,CAAC;QAQ3B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,aAAa,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC;IAClD,CAAC;IAED,wFAAwF;IAExF;;;;OAIG;IACI,MAAM,CAAC,KAAY;QAEtB,KAAK,CAAC,cAAc,EAAE,CAAC;QAE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AC,KAAK,CAAC;IAChE,CAAC;IAED;;;OAGG;IACO,wBAAwB,CAAC,GAAyB;QAExD,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,WAAY,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACO,aAAa,CAAC,GAAyB,EAAE,MAAa;QAE5D,OAAO,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,GAAyB;QAE9C,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;;uHA1OQ,0BAA0B,kBAkBf,QAAQ;2GAlBnB,0BAA0B,mFClCvC,qxCAoBM;2FDcO,0BAA0B;kBAPtC,SAAS;+BAEI,sBAAsB,mBAGf,uBAAuB,CAAC,MAAM;;0BAoBlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday',\n clickable: 'clickable'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"lower\" period\n * @param event - Event that occured\n * @internal\n */\n public goDown(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoDown)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleDown.next(this.displayDate.value);\n }\n }\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.addMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed month to previous month\n * @param event - Event that occured\n * @internal\n */\n public previousMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>): void\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n this._setPeriod(day);\n\n //when time picker is enabled\n if(this.canGoDown)\n {\n const from = this._dateApi\n .getValue(day.date)\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n const to = this._dateApi\n .getValue(this._endOfPeriod(day))\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n this._value =\n {\n from: from.value,\n to: to.value\n };\n }\n //no time picker\n else\n {\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n }\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n //can go down set minutes and hours\n if(this.canGoDown)\n {\n this.displayDate\n .minute(this._originalMinute)\n .hour(this._originalHour);\n }\n\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{displayDate?.value | dateFormat: 'time'}}</div>\r\n</div>"]}
1
+ {"version":3,"file":"dayPicker.component.js","sourceRoot":"","sources":["../../../../../src/picker/components/dayPicker/dayPicker.component.ts","../../../../../src/picker/components/dayPicker/dayPicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,MAAM,EAAE,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAC,MAAM,EAAC,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,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,GAAyB;QAE9C,OAAO,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;IACrD,CAAC;;uHAlPQ,0BAA0B,kBA0Bf,QAAQ;2GA1BnB,0BAA0B,mFCnCvC,kxCAoBM;2FDeO,0BAA0B;kBAPtC,SAAS;+BAEI,sBAAsB,mBAGf,uBAAuB,CAAC,MAAM;;0BA4BlC,MAAM;2BAAC,QAAQ","sourcesContent":["import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef} from '@angular/core';\nimport {extend} from '@jscrpt/common';\n\nimport {DateTimeValue} from '../../../misc/datetime.interface';\nimport {DATE_API} from '../../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../../services/dateApi.interface';\nimport {DateTimePicker, DayData, PeriodData} from '../../misc/datetimePicker.interface';\nimport {PickerBaseComponent} from '../pickerBase.component';\nimport {DayPickerCssClasses} from './dayPicker.interfaces';\n\n/**\n * Default styles for picker\n */\nconst defaultStyles: DayPickerCssClasses =\n{\n periodSelection: 'period',\n previousPeriod: 'fas fa-angle-left clickable',\n nextPeriod: 'fas fa-angle-right clickable',\n periodValue: 'period-value',\n periodData: 'period-data',\n periodDatum: 'period-datum clickable',\n weekdayName: 'weekday',\n clickable: 'clickable'\n};\n\n/**\n * Component used for displaying day picker\n */\n@Component(\n{\n selector: 'date-time-day-picker',\n templateUrl: 'dayPicker.component.html',\n styleUrls: ['dayPicker.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimeDayPickerComponent<TDate = any> extends PickerBaseComponent<TDate, DayData<TDate>, DayPickerCssClasses> implements DateTimePicker<TDate, DayPickerCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Stored this picker month data\n */\n protected _thisMonthData: DayData<TDate>[] = [];\n\n //######################### public properties - template bindings #########################\n\n /**\n * Names of days\n * @internal\n */\n public weekdays: string[] = [];\n\n /**\n * Value used for displaying time\n */\n public get timeValue(): DateTimeValue<TDate> | null\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) dateApi: DateApi<TDate>,\n changeDetector: ChangeDetectorRef)\n {\n super(dateApi, changeDetector);\n\n this.cssClasses = extend(true, {}, defaultStyles);\n this.weekdays = this._dateApi.weekdaysShort();\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"lower\" period\n * @param event - Event that occured\n * @internal\n */\n public goDown(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoDown)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleDown.next(this.displayDate.value);\n }\n }\n\n /**\n * Changes displayed month to next month\n * @param event - Event that occured\n * @internal\n */\n public nextMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.addMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Changes displayed month to previous month\n * @param event - Event that occured\n * @internal\n */\n public previousMonth(event: Event): void\n {\n event.preventDefault();\n this.displayDate!.subtractMonths(1);\n\n this.display(this.displayDate!);\n }\n\n /**\n * Selects day\n * @param event - Event that occured\n * @param day - Selects day \n * @internal\n */\n public override select(event: Event, day: DayData<TDate>): void\n {\n event.preventDefault();\n\n if(day.disabled)\n {\n return;\n }\n\n this._setPeriod(day);\n\n //when time picker is enabled\n if(this.canGoDown)\n {\n const from = this._dateApi\n .getValue(day.date)\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n const to = this._dateApi\n .getValue(this._endOfPeriod(day))\n .hour(this._originalHour)\n .minute(this._originalMinute);\n\n this._value =\n {\n from: from.value,\n to: to.value\n };\n }\n //no time picker\n else\n {\n this._value =\n {\n from: day.date,\n to: this._endOfPeriod(day)\n };\n }\n \n this._valueChange.next();\n\n if(day.otherMonth)\n {\n this.display(this._dateApi.getValue(day.date));\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public display(value: DateApiObject<TDate>): void\n {\n this.displayDate = value;\n this.periodData = [];\n this._thisMonthData = [];\n const currentMonthDate = this.displayDate.value;\n const today = this._dateApi.now().value;\n\n this.displayDate\n .startOfMonth()\n .updateOriginal()\n .startOfWeek();\n\n do\n {\n for(let x = 0; x < 7; x++)\n {\n const day = this.displayDate.dayOfMonth();\n const otherMonth = !this.displayDate.isSameMonth(currentMonthDate);\n const data = \n {\n active: false,\n disabled: false,\n betweenActive: false,\n date: this.displayDate.value,\n otherMonth: otherMonth,\n today: this.displayDate.isSameDay(today),\n weekend: this.displayDate.isWeekend(),\n day: day\n };\n\n this.periodData.push(data);\n\n if(!otherMonth)\n {\n this._thisMonthData.push(data);\n }\n\n this.displayDate.addDays(1);\n }\n }\n while(this.displayDate.isSameMonth(currentMonthDate));\n\n this.displayDate.resetOriginal();\n\n //can go down set minutes and hours\n if(this.canGoDown)\n {\n this.displayDate\n .minute(this._originalMinute)\n .hour(this._originalHour);\n }\n\n this._updateMinMax();\n\n //set value if exists\n if(this._value && (this.displayDate.isSameMonth(this._value.from) || this.displayDate.isSameMonth(this._value.to)))\n {\n this.setValue(this._value);\n }\n }\n\n //######################### protected methods #########################\n\n /**\n * Obtains end of period\n * @param period - Period for which should be end obtained\n */\n protected _endOfPeriod(period: PeriodData<TDate>): TDate\n {\n return this._dateApi.getValue(period.date).endOfDay().value;\n }\n\n /**\n * Tests whether provided value is in same period as displayed picker\n * @param val - Tested value for same period as displayed picker\n */\n protected _isSamePeriodAsDisplayed(val: DateApiObject<TDate>): boolean\n {\n return val.isSameMonth(this.displayDate!.value);\n }\n\n /**\n * Tests whether provided value is in same period target value\n * @param val - Tested value\n * @param target - Target value to be tested against\n */\n protected _isSamePeriod(val: DateApiObject<TDate>, target: TDate): boolean\n {\n return val.isSameDay(target);\n }\n\n /**\n * Gets period data for specified value\n * @param val - Value for which is period data obtained\n */\n protected _getPeriodData(val: DateApiObject<TDate>): PeriodData<TDate>\n {\n return this._thisMonthData[val.dayOfMonth() - 1];\n }\n}","<div [ngClass]=\"cssClasses?.periodSelection | asRequired\">\r\n <div [ngClass]=\"cssClasses?.previousPeriod | asRequired\" (mousedown)=\"previousMonth($event)\"></div>\r\n <div [ngClass]=\"cssClasses?.periodValue | asRequired | mergeCssClasses: [{'clickable': canGoUp}]\" (mousedown)=\"goUp($event)\">{{displayDate?.format('MMMM yyyy')}}</div>\r\n <div [ngClass]=\"cssClasses?.nextPeriod | asRequired\" (mousedown)=\"nextMonth($event)\"></div>\r\n</div>\r\n\r\n<div [ngClass]=\"cssClasses?.periodData | asRequired\">\r\n <div [ngClass]=\"cssClasses?.weekdayName | asRequired\" *ngFor=\"let weekday of weekdays\">{{weekday}}</div>\r\n <div *ngFor=\"let day of periodData\"\r\n [ngClass]=\"cssClasses?.periodDatum | asRequired\"\r\n [class.other-month]=\"day.otherMonth\"\r\n [class.today]=\"day.today\"\r\n [class.weekend]=\"day.weekend\"\r\n [class.active]=\"day.active\"\r\n [class.disabled]=\"day.disabled\"\r\n (mousedown)=\"select($event, day)\">{{day.day}}</div>\r\n</div>\r\n\r\n<div class=\"flex-row\" style=\"justify-content: center; border-top: 1px solid #FFF;\" *ngIf=\"canGoDown\">\r\n <div [class.clickable]=\"canGoDown\" (mousedown)=\"goDown($event)\">{{timeValue?.from | dateFormat: 'time'}}</div>\r\n</div>"]}
@@ -1 +1 @@
1
- {"version":3,"file":"pickerImplBase.component.js","sourceRoot":"","sources":["../../../../src/picker/components/pickerImplBase.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;;AAI3C;;GAEG;AAEH,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,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC9C;IACL,CAAC;IAED,uGAAuG;IAEvG;;;OAGG;IACI,aAAa,CAAC,UAAuB;QAExC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;IA0BD;;;OAGG;IACI,YAAY,CAAC,KAAc;QAE9B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,KAAc;QAE5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,iBAAiB;QAEpB,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED,2EAA2E;IAE3E;;;;OAIG;IAEI,WAAW,CAAC,KAAY;QAE3B,KAAK,CAAC,cAAc,EAAE,CAAC;IAC3B,CAAC;;oHAlMiB,uBAAuB,kBA+FrB,QAAQ;wGA/FV,uBAAuB;2FAAvB,uBAAuB;kBAD5C,SAAS;;0BAgGO,MAAM;2BAAC,QAAQ;4EAgGrB,WAAW;sBADjB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ChangeDetectorRef, Directive, HostListener, Inject} from '@angular/core';\nimport {extend} from '@jscrpt/common';\nimport {Observable, Subject} from 'rxjs';\n\nimport {DateTimeValue} from '../../misc/datetime.interface';\nimport {DATE_API} from '../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../services/dateApi.interface';\nimport {DateTimePicker} from '../misc/datetimePicker.interface';\n\n/**\n * Base class used as base for picker as base implementation of DateTimePicker interface\n */\n@Directive()\nexport abstract class PickerImplBaseComponent<TDate = any, TCssClasses = any> implements DateTimePicker<TDate, TCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Current value of datetime\n */\n protected _value: DateTimeValue<TDate>|null = null;\n\n /**\n * Occurs when value changes\n */\n protected _valueChange: Subject<void> = new Subject<void>();\n \n /**\n * Occurs when user scales up\n */\n protected _scaleUp: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Occurs when user scales down\n */\n protected _scaleDown: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Minimal possible value that can be picked\n */\n protected _minValue: TDate|null = null;\n\n /**\n * Maximal possible value that can be picked\n */\n protected _maxValue: TDate|null = null;\n\n //######################### public properties - implementation of DateTimePicker #########################\n\n /**\n * Gets current value of datetime\n */\n public get value(): DateTimeValue<TDate>|null\n {\n return this._value;\n }\n\n /**\n * Occurs when value changes\n */\n public get valueChange(): Observable<void>\n {\n return this._valueChange.asObservable();\n }\n\n /**\n * Occurs when user scales up\n */\n public get scaleUp(): Observable<TDate>\n {\n return this._scaleUp.asObservable();\n }\n\n /**\n * Occurs when user scales down\n */\n public get scaleDown(): Observable<TDate>\n {\n return this._scaleDown.asObservable();\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Date api instance for displayed date\n * @internal\n */\n public displayDate: DateApiObject<TDate>|null = null;\n\n /**\n * Indication whether can go up in period\n * @internal\n */\n public canGoUp: boolean = false;\n\n /**\n * Indication whether can go down in period\n * @internal\n */\n public canGoDown: boolean = false;\n\n /**\n * Css classes that are used within picker\n * @internal\n */\n public cssClasses!: TCssClasses;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n protected _changeDetector: ChangeDetectorRef)\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"higher\" period\n * @param event - Event that occured\n * @internal\n */\n public goUp(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoUp)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleUp.next(this.displayDate.value);\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Sets css classes for picker, allowing to override defaults\n * @param cssClasses - Css classes to be set for picker\n */\n public setCssClasses(cssClasses: TCssClasses): void\n {\n this.cssClasses = extend(true, {}, this.cssClasses, cssClasses);\n }\n\n /**\n * Sets minimal possible value for picker, that can be picked\n * @param value - Minimal possible value that can be picked\n */\n public abstract setMinValue(value: TDate|null): void;\n\n /**\n * Sets maximal possible value for picker, that can be picked\n * @param value - Maximal possible value that can be picked\n */\n public abstract setMaxValue(value: TDate|null): void;\n\n /**\n * Sets value of datetime picker\n * @param value - Value to be set to this picker\n */\n public abstract setValue(value: DateTimeValue<TDate>|null): void;\n\n /**\n * Set displays date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public abstract display(value: DateApiObject<TDate>): void;\n\n /**\n * Sets indication whether can go down\n * @param value - Indication whether can go down in period\n */\n public setCanGoDown(value: boolean): void\n {\n this.canGoDown = value;\n }\n\n /**\n * Sets indication whether can go up\n * @param value - Indication whether can go up in period\n */\n public setCanGoUp(value: boolean): void\n {\n this.canGoUp = value;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles click anyway in picker, that blocks blur\n * @param event - Event that occured\n * @internal\n */\n @HostListener('mousedown', ['$event'])\n public handleClick(event: Event): void\n {\n event.preventDefault();\n }\n}"]}
1
+ {"version":3,"file":"pickerImplBase.component.js","sourceRoot":"","sources":["../../../../src/picker/components/pickerImplBase.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAC,MAAM,eAAe,CAAC;AACjF,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAGzC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;;AAI3C;;GAEG;AAEH,MAAM,OAAgB,uBAAuB;IA8FzC,iEAAiE;IACjE,YAAwC,QAAwB,EAC1C,eAAkC;QADhB,aAAQ,GAAR,QAAQ,C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aAAa,CAAC,UAAuB;QAExC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACpE,CAAC;IA0BD;;;OAGG;IACI,YAAY,CAAC,KAAc;QAE9B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,KAAc;QAE5B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED;;OAEG;IACI,iBAAiB;QAEpB,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAED,2EAA2E;IAE3E;;;;OAIG;IAEI,WAAW,CAAC,KAAY;QAE3B,KAAK,CAAC,cAAc,EAAE,CAAC;IAC3B,CAAC;;oHAlMiB,uBAAuB,kBA+FrB,QAAQ;wGA/FV,uBAAuB;2FAAvB,uBAAuB;kBAD5C,SAAS;;0BAgGO,MAAM;2BAAC,QAAQ;4EAgGrB,WAAW;sBADjB,YAAY;uBAAC,WAAW,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {ChangeDetectorRef, Directive, HostListener, Inject} from '@angular/core';\nimport {extend} from '@jscrpt/common';\nimport {Observable, Subject} from 'rxjs';\n\nimport {DateTimeValue} from '../../misc/datetime.interface';\nimport {DATE_API} from '../../misc/tokens';\nimport {DateApi, DateApiObject} from '../../services/dateApi.interface';\nimport {DateTimePicker} from '../misc/datetimePicker.interface';\n\n/**\n * Base class used as base for picker as base implementation of DateTimePicker interface\n */\n@Directive()\nexport abstract class PickerImplBaseComponent<TDate = any, TCssClasses = any> implements DateTimePicker<TDate, TCssClasses>\n{\n //######################### protected fields #########################\n\n /**\n * Current value of datetime\n */\n protected _value: DateTimeValue<TDate>|null = null;\n\n /**\n * Occurs when value changes\n */\n protected _valueChange: Subject<void> = new Subject<void>();\n \n /**\n * Occurs when user scales up\n */\n protected _scaleUp: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Occurs when user scales down\n */\n protected _scaleDown: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Minimal possible value that can be picked\n */\n protected _minValue: TDate|null = null;\n\n /**\n * Maximal possible value that can be picked\n */\n protected _maxValue: TDate|null = null;\n\n //######################### public properties - implementation of DateTimePicker #########################\n\n /**\n * Gets current value of datetime\n */\n public get value(): DateTimeValue<TDate>|null\n {\n return this._value;\n }\n\n /**\n * Occurs when value changes\n */\n public get valueChange(): Observable<void>\n {\n return this._valueChange.asObservable();\n }\n\n /**\n * Occurs when user scales up\n */\n public get scaleUp(): Observable<TDate>\n {\n return this._scaleUp.asObservable();\n }\n\n /**\n * Occurs when user scales down\n */\n public get scaleDown(): Observable<TDate>\n {\n return this._scaleDown.asObservable();\n }\n\n //######################### public properties - template bindings #########################\n\n /**\n * Date api instance for displayed date\n * @internal\n */\n public displayDate: DateApiObject<TDate>|null = null;\n\n /**\n * Indication whether can go up in period\n * @internal\n */\n public canGoUp: boolean = false;\n\n /**\n * Indication whether can go down in period\n * @internal\n */\n public canGoDown: boolean = false;\n\n /**\n * Css classes that are used within picker\n * @internal\n */\n public cssClasses!: TCssClasses;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n protected _changeDetector: ChangeDetectorRef)\n {\n }\n\n //######################### public methods - template bindings #########################\n\n /**\n * Changes displayed period to \"higher\" period\n * @param event - Event that occured\n * @internal\n */\n public goUp(event: Event): void\n {\n event.preventDefault();\n\n if(!this.canGoUp)\n {\n return;\n }\n\n if(this.displayDate)\n {\n this._scaleUp.next(this.displayDate.value);\n }\n }\n\n //######################### public methods - implementation of DateTimePicker #########################\n\n /**\n * Sets css classes for picker, allowing to override defaults\n * @param cssClasses - Css classes to be set for picker\n */\n public setCssClasses(cssClasses: TCssClasses): void\n {\n this.cssClasses = extend(true, {}, this.cssClasses, cssClasses);\n }\n\n /**\n * Sets minimal possible value for picker, that can be picked\n * @param value - Minimal possible value that can be picked\n */\n public abstract setMinValue(value: TDate|null): void;\n\n /**\n * Sets maximal possible value for picker, that can be picked\n * @param value - Maximal possible value that can be picked\n */\n public abstract setMaxValue(value: TDate|null): void;\n\n /**\n * Sets value of datetime picker\n * @param value - Value to be set to this picker\n */\n public abstract setValue(value: DateTimeValue<TDate>|null): void;\n\n /**\n * Sets display date to be displayed\n * @param value - Value that identifies period that is going to be displayed\n */\n public abstract display(value: DateApiObject<TDate>): void;\n\n /**\n * Sets indication whether can go down\n * @param value - Indication whether can go down in period\n */\n public setCanGoDown(value: boolean): void\n {\n this.canGoDown = value;\n }\n\n /**\n * Sets indication whether can go up\n * @param value - Indication whether can go up in period\n */\n public setCanGoUp(value: boolean): void\n {\n this.canGoUp = value;\n }\n\n /**\n * Explicitly runs invalidation of content (change detection)\n */\n public invalidateVisuals(): void\n {\n this._changeDetector.detectChanges();\n }\n\n //######################### public methods - host #########################\n\n /**\n * Handles click anyway in picker, that blocks blur\n * @param event - Event that occured\n * @internal\n */\n @HostListener('mousedown', ['$event'])\n public handleClick(event: Event): void\n {\n event.preventDefault();\n }\n}"]}