@anglr/datetime 8.1.0 → 9.0.0-beta.20241007050425

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 (173) hide show
  1. package/changelog.md +68 -1
  2. package/date-fns/src/services/dateFnsDateApi.service.d.ts +62 -130
  3. package/date-fns/src/services/dateFnsDateApi.service.d.ts.map +1 -1
  4. package/es2022/date-fns/src/services/dateFnsDateApi.service.js +71 -143
  5. package/es2022/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
  6. package/es2022/moment/src/services/momentDateApi.service.js +64 -140
  7. package/es2022/moment/src/services/momentDateApi.service.js.map +1 -1
  8. package/es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js +17 -30
  9. package/es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js.map +1 -1
  10. package/es2022/src/directives/datePickerInput/datePickerInput.directive.js +9 -9
  11. package/es2022/src/directives/datePickerInput/datePickerInput.directive.js.map +1 -1
  12. package/es2022/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js +16 -26
  13. package/es2022/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js.map +1 -1
  14. package/es2022/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js +8 -8
  15. package/es2022/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +1 -1
  16. package/es2022/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js +9 -9
  17. package/es2022/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +1 -1
  18. package/es2022/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js +7 -11
  19. package/es2022/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +1 -1
  20. package/es2022/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js +8 -8
  21. package/es2022/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +1 -1
  22. package/es2022/src/directives/withNow/withNow.directive.js +11 -11
  23. package/es2022/src/directives/withNow/withNow.directive.js.map +1 -1
  24. package/es2022/src/directives/withTime/withTime.directive.js +10 -10
  25. package/es2022/src/directives/withTime/withTime.directive.js.map +1 -1
  26. package/es2022/src/directives/withToday/withToday.directive.js +11 -11
  27. package/es2022/src/directives/withToday/withToday.directive.js.map +1 -1
  28. package/es2022/src/interfaces/dateTimeInput/dateTimeInput.interface.js.map +1 -1
  29. package/es2022/src/misc/enums.js +8 -4
  30. package/es2022/src/misc/enums.js.map +1 -1
  31. package/es2022/src/misc/utils.js +7 -6
  32. package/es2022/src/misc/utils.js.map +1 -1
  33. package/es2022/src/misc/validators.js.map +1 -1
  34. package/es2022/src/modules/calendar/components/monthCalendar/monthCalendar.component.js +40 -68
  35. package/es2022/src/modules/calendar/components/monthCalendar/monthCalendar.component.js.map +1 -1
  36. package/es2022/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js +5 -5
  37. package/es2022/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js.map +1 -1
  38. package/es2022/src/modules/calendar/modules/monthCalendar.module.js +7 -11
  39. package/es2022/src/modules/calendar/modules/monthCalendar.module.js.map +1 -1
  40. package/es2022/src/modules/calendar/services/eventParser/eventParser.service.js +3 -4
  41. package/es2022/src/modules/calendar/services/eventParser/eventParser.service.js.map +1 -1
  42. package/es2022/src/modules/datePipes.module.js +6 -6
  43. package/es2022/src/modules/datePipes.module.js.map +1 -1
  44. package/es2022/src/modules/dateTime/directives/dateTime/dateTime.directive.js +41 -72
  45. package/es2022/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -1
  46. package/es2022/src/modules/dateTime/directives/dateTimeBase.js +21 -25
  47. package/es2022/src/modules/dateTime/directives/dateTimeBase.js.map +1 -1
  48. package/es2022/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js +36 -16
  49. package/es2022/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js.map +1 -1
  50. package/es2022/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +18 -26
  51. package/es2022/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  52. package/es2022/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +12 -13
  53. package/es2022/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -1
  54. package/es2022/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +12 -13
  55. package/es2022/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -1
  56. package/es2022/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +12 -13
  57. package/es2022/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -1
  58. package/es2022/src/modules/dateTime/modules/dateTime.module.js +27 -27
  59. package/es2022/src/modules/dateTime/modules/dateTime.module.js.map +1 -1
  60. package/es2022/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +39 -58
  61. package/es2022/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -1
  62. package/es2022/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +21 -57
  63. package/es2022/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -1
  64. package/es2022/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +17 -20
  65. package/es2022/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -1
  66. package/es2022/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js +6 -10
  67. package/es2022/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js.map +1 -1
  68. package/es2022/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js +31 -29
  69. package/es2022/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
  70. package/es2022/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js +13 -13
  71. package/es2022/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js.map +1 -1
  72. package/es2022/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +11 -40
  73. package/es2022/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -1
  74. package/es2022/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js +40 -55
  75. package/es2022/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js.map +1 -1
  76. package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js +8 -14
  77. package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js.map +1 -1
  78. package/es2022/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.js.map +1 -1
  79. package/es2022/src/modules/dateTimePicker/modules/dateTimePicker.module.js +9 -10
  80. package/es2022/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -1
  81. package/es2022/src/pipes/dateConvert.pipe.js +4 -5
  82. package/es2022/src/pipes/dateConvert.pipe.js.map +1 -1
  83. package/es2022/src/pipes/dateFormat.pipe.js +4 -6
  84. package/es2022/src/pipes/dateFormat.pipe.js.map +1 -1
  85. package/es2022/src/services/dateApi/dateApi.interface.js.map +1 -1
  86. package/es2022/src/services/datePositionParser/datePositionParser.service.js +16 -17
  87. package/es2022/src/services/datePositionParser/datePositionParser.service.js.map +1 -1
  88. package/es2022/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js +3 -9
  89. package/es2022/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js.map +1 -1
  90. package/es2022/src/services/dateValueProvider/dateValueProvider.service.js +3 -5
  91. package/es2022/src/services/dateValueProvider/dateValueProvider.service.js.map +1 -1
  92. package/lerna.json +4 -0
  93. package/moment/src/services/momentDateApi.service.d.ts +63 -132
  94. package/moment/src/services/momentDateApi.service.d.ts.map +1 -1
  95. package/package.json +41 -43
  96. package/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.d.ts +3 -3
  97. package/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.d.ts.map +1 -1
  98. package/src/directives/datePickerInput/datePickerInput.directive.d.ts +3 -3
  99. package/src/directives/datePickerInput/datePickerInput.directive.d.ts.map +1 -1
  100. package/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.d.ts +7 -7
  101. package/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.d.ts.map +1 -1
  102. package/src/directives/dateTimePickerInput/dateTimePickerInput.directive.d.ts +3 -3
  103. package/src/directives/dateTimePickerInput/dateTimePickerInput.directive.d.ts.map +1 -1
  104. package/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.d.ts +3 -3
  105. package/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.d.ts.map +1 -1
  106. package/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.d.ts +7 -7
  107. package/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.d.ts.map +1 -1
  108. package/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.d.ts +3 -3
  109. package/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.d.ts.map +1 -1
  110. package/src/directives/withNow/withNow.directive.d.ts +5 -5
  111. package/src/directives/withNow/withNow.directive.d.ts.map +1 -1
  112. package/src/directives/withTime/withTime.directive.d.ts +5 -5
  113. package/src/directives/withTime/withTime.directive.d.ts.map +1 -1
  114. package/src/directives/withToday/withToday.directive.d.ts +5 -5
  115. package/src/directives/withToday/withToday.directive.d.ts.map +1 -1
  116. package/src/interfaces/dateTimeInput/dateTimeInput.interface.d.ts +1 -1
  117. package/src/misc/enums.d.ts +8 -4
  118. package/src/misc/enums.d.ts.map +1 -1
  119. package/src/misc/utils.d.ts +3 -3
  120. package/src/misc/utils.d.ts.map +1 -1
  121. package/src/modules/calendar/components/monthCalendar/monthCalendar.component.d.ts +1 -1
  122. package/src/modules/calendar/components/monthCalendar/monthCalendar.component.d.ts.map +1 -1
  123. package/src/modules/calendar/components/monthCalendar/monthCalendar.component.html +17 -9
  124. package/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.d.ts +1 -1
  125. package/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.d.ts.map +1 -1
  126. package/src/modules/calendar/modules/monthCalendar.module.d.ts +3 -4
  127. package/src/modules/calendar/modules/monthCalendar.module.d.ts.map +1 -1
  128. package/src/modules/datePipes.module.d.ts +1 -1
  129. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts +3 -3
  130. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts.map +1 -1
  131. package/src/modules/dateTime/directives/dateTimeBase.d.ts +3 -3
  132. package/src/modules/dateTime/directives/dateTimeBase.d.ts.map +1 -1
  133. package/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.d.ts +6 -4
  134. package/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.d.ts.map +1 -1
  135. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts +3 -3
  136. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
  137. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts +3 -3
  138. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts.map +1 -1
  139. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts +3 -3
  140. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts.map +1 -1
  141. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts +3 -3
  142. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts.map +1 -1
  143. package/src/modules/dateTime/modules/dateTime.module.d.ts +1 -1
  144. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +4 -4
  145. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -1
  146. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html +1 -1
  147. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts +3 -3
  148. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  149. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html +21 -12
  150. package/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.d.ts +3 -3
  151. package/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.d.ts.map +1 -1
  152. package/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.html +7 -5
  153. package/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.d.ts +3 -3
  154. package/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.d.ts.map +1 -1
  155. package/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.html +41 -29
  156. package/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.d.ts +3 -3
  157. package/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.d.ts.map +1 -1
  158. package/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.html +7 -5
  159. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts +5 -5
  160. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -1
  161. package/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.d.ts +7 -7
  162. package/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.d.ts.map +1 -1
  163. package/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.d.ts +3 -3
  164. package/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.d.ts.map +1 -1
  165. package/src/modules/dateTimePicker/interfaces/periodData/periodData.interface.d.ts.map +1 -1
  166. package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts +3 -3
  167. package/src/modules/dateTimePicker/modules/dateTimePicker.module.d.ts.map +1 -1
  168. package/src/pipes/dateConvert.pipe.d.ts +1 -1
  169. package/src/pipes/dateFormat.pipe.d.ts +1 -1
  170. package/src/services/dateApi/dateApi.interface.d.ts +11 -1
  171. package/src/services/dateApi/dateApi.interface.d.ts.map +1 -1
  172. package/src/services/dateValueProvider/dateValueProvider.service.d.ts.map +1 -1
  173. package/version.bak +1 -1
@@ -8,24 +8,15 @@ import * as i1 from "@anglr/datetime";
8
8
  * Instance of object wrapping TDate, allowing manipulation with it
9
9
  */
10
10
  export class MomentDateApiObject {
11
- //######################### protected fields #########################
12
- /**
13
- * Original value that is not changed unless 'updateOriginal' is called
14
- */
15
- _originalValue;
16
- /**
17
- * Instance of date
18
- */
19
- _value;
20
11
  //######################### public properties - implementation of DateApiObject #########################
21
12
  /**
22
- * Original value that is not changed unless 'updateOriginal' is called
13
+ * @inheritdoc
23
14
  */
24
15
  get originalValue() {
25
16
  return this._originalValue;
26
17
  }
27
18
  /**
28
- * Instance of date
19
+ * @inheritdoc
29
20
  */
30
21
  get value() {
31
22
  return this._value;
@@ -36,21 +27,20 @@ export class MomentDateApiObject {
36
27
  }
37
28
  //######################### public methods - implementation of DateApiObject #########################
38
29
  /**
39
- * Gets indication whether provided instance of date is valid
30
+ * @inheritdoc
40
31
  */
41
32
  isValid() {
42
33
  return this._value.isValid();
43
34
  }
44
35
  /**
45
- * Gets indication whether provided instance of date is weekend day
36
+ * @inheritdoc
46
37
  */
47
38
  isWeekend() {
48
39
  const weekday = this._value.isoWeekday();
49
40
  return weekday == 6 || weekday == 7;
50
41
  }
51
42
  /**
52
- * Formats date value
53
- * @param format - Format token used for creating formatted string
43
+ * @inheritdoc
54
44
  */
55
45
  format(format) {
56
46
  return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));
@@ -68,8 +58,13 @@ export class MomentDateApiObject {
68
58
  return this._value.unix();
69
59
  }
70
60
  /**
71
- * Updates value to start date and time of current decade
72
- * @returns Itself for fluent API
61
+ * @inheritdoc
62
+ */
63
+ timestamp() {
64
+ return this._value.valueOf();
65
+ }
66
+ /**
67
+ * @inheritdoc
73
68
  */
74
69
  startOfDecade() {
75
70
  const diff = (this._value.year() % 10);
@@ -77,8 +72,7 @@ export class MomentDateApiObject {
77
72
  return this;
78
73
  }
79
74
  /**
80
- * Updates value to end date and time of current decade
81
- * @returns Itself for fluent API
75
+ * @inheritdoc
82
76
  */
83
77
  endOfDecade() {
84
78
  const diff = 9 - (this._value.year() % 10);
@@ -86,219 +80,179 @@ export class MomentDateApiObject {
86
80
  return this;
87
81
  }
88
82
  /**
89
- * Updates value to start date and time of current year
90
- * @returns Itself for fluent API
83
+ * @inheritdoc
91
84
  */
92
85
  startOfYear() {
93
86
  this._value = moment(this._value).startOf('year');
94
87
  return this;
95
88
  }
96
89
  /**
97
- * Updates value to end date and time of current year
98
- * @returns Itself for fluent API
90
+ * @inheritdoc
99
91
  */
100
92
  endOfYear() {
101
93
  this._value = moment(this._value).endOf('year');
102
94
  return this;
103
95
  }
104
96
  /**
105
- * Add years, if count not specified adds 1 year
106
- * @param count - Number of years count
107
- * @returns Itself for fluent API
97
+ * @inheritdoc
108
98
  */
109
99
  addYears(count) {
110
100
  this._value = moment(this._value).add(count ?? 1, 'years');
111
101
  return this;
112
102
  }
113
103
  /**
114
- * Subtract years, if count not specified subtract 1 year
115
- * @param count - Number of years count
116
- * @returns Itself for fluent API
104
+ * @inheritdoc
117
105
  */
118
106
  subtractYears(count) {
119
107
  this._value = moment(this._value).subtract(count ?? 1, 'years');
120
108
  return this;
121
109
  }
122
110
  /**
123
- * Updates value to start date and time of current month
124
- * @returns Itself for fluent API
111
+ * @inheritdoc
125
112
  */
126
113
  startOfMonth() {
127
114
  this._value = moment(this._value).startOf('month');
128
115
  return this;
129
116
  }
130
117
  /**
131
- * Updates value to end date and time of current month
132
- * @returns Itself for fluent API
118
+ * @inheritdoc
133
119
  */
134
120
  endOfMonth() {
135
121
  this._value = moment(this._value).endOf('month');
136
122
  return this;
137
123
  }
138
124
  /**
139
- * Add months, if count not specified adds 1 month
140
- * @param count - Number of months count
141
- * @returns Itself for fluent API
125
+ * @inheritdoc
142
126
  */
143
127
  addMonths(count) {
144
128
  this._value = moment(this._value).add(count ?? 1, 'months');
145
129
  return this;
146
130
  }
147
131
  /**
148
- * Subtract months, if count not specified subtract 1 month
149
- * @param count - Number of months count
150
- * @returns Itself for fluent API
132
+ * @inheritdoc
151
133
  */
152
134
  subtractMonths(count) {
153
135
  this._value = moment(this._value).subtract(count ?? 1, 'months');
154
136
  return this;
155
137
  }
156
138
  /**
157
- * Updates value to start date and time of current week
158
- * @returns Itself for fluent API
139
+ * @inheritdoc
159
140
  */
160
141
  startOfWeek() {
161
142
  this._value = moment(this._value).startOf('week');
162
143
  return this;
163
144
  }
164
145
  /**
165
- * Updates value to end date and time of current week
166
- * @returns Itself for fluent API
146
+ * @inheritdoc
167
147
  */
168
148
  endOfWeek() {
169
149
  this._value = moment(this._value).endOf('week');
170
150
  return this;
171
151
  }
172
152
  /**
173
- * Add weeks, if count not specified adds 1 week
174
- * @param count - Number of weeks count
175
- * @returns Itself for fluent API
153
+ * @inheritdoc
176
154
  */
177
155
  addWeeks(count) {
178
156
  this._value = moment(this._value).add(count ?? 1, 'weeks');
179
157
  return this;
180
158
  }
181
159
  /**
182
- * Subtract weeks, if count not specified subtract 1 week
183
- * @param count - Number of weeks count
184
- * @returns Itself for fluent API
160
+ * @inheritdoc
185
161
  */
186
162
  subtractWeeks(count) {
187
163
  this._value = moment(this._value).subtract(count ?? 1, 'weeks');
188
164
  return this;
189
165
  }
190
166
  /**
191
- * Updates value to start date and time of current day
192
- * @returns Itself for fluent API
167
+ * @inheritdoc
193
168
  */
194
169
  startOfDay() {
195
170
  this._value = moment(this._value).startOf('day');
196
171
  return this;
197
172
  }
198
173
  /**
199
- * Updates value to end date and time of current day
200
- * @returns Itself for fluent API
174
+ * @inheritdoc
201
175
  */
202
176
  endOfDay() {
203
177
  this._value = moment(this._value).endOf('day');
204
178
  return this;
205
179
  }
206
180
  /**
207
- * Add days, if count not specified adds 1 day
208
- * @param count - Number of days count
209
- * @returns Itself for fluent API
181
+ * @inheritdoc
210
182
  */
211
183
  addDays(count) {
212
184
  this._value = moment(this._value).add(count ?? 1, 'days');
213
185
  return this;
214
186
  }
215
187
  /**
216
- * Subtract days, if count not specified subtract 1 day
217
- * @param count - Number of days count
218
- * @returns Itself for fluent API
188
+ * @inheritdoc
219
189
  */
220
190
  subtractDays(count) {
221
191
  this._value = moment(this._value).subtract(count ?? 1, 'days');
222
192
  return this;
223
193
  }
224
194
  /**
225
- * Updates value to start date and time of current hour
226
- * @returns Itself for fluent API
195
+ * @inheritdoc
227
196
  */
228
197
  startOfHour() {
229
198
  this._value = moment(this._value).startOf('hour');
230
199
  return this;
231
200
  }
232
201
  /**
233
- * Updates value to end date and time of current hour
234
- * @returns Itself for fluent API
202
+ * @inheritdoc
235
203
  */
236
204
  endOfHour() {
237
205
  this._value = moment(this._value).endOf('hour');
238
206
  return this;
239
207
  }
240
208
  /**
241
- * Add hours, if count not specified adds 1 hour
242
- * @param count - Number of hours count
243
- * @returns Itself for fluent API
209
+ * @inheritdoc
244
210
  */
245
211
  addHours(count) {
246
212
  this._value = moment(this._value).add(count ?? 1, 'hours');
247
213
  return this;
248
214
  }
249
215
  /**
250
- * Subtract hours, if count not specified subtract 1 hour
251
- * @param count - Number of hours count
252
- * @returns Itself for fluent API
216
+ * @inheritdoc
253
217
  */
254
218
  subtractHours(count) {
255
219
  this._value = moment(this._value).subtract(count ?? 1, 'hours');
256
220
  return this;
257
221
  }
258
222
  /**
259
- * Updates value to start date and time of current minute
260
- * @returns Itself for fluent API
223
+ * @inheritdoc
261
224
  */
262
225
  startOfMinute() {
263
226
  this._value = moment(this._value).startOf('minute');
264
227
  return this;
265
228
  }
266
229
  /**
267
- * Updates value to end date and time of current minute
268
- * @returns Itself for fluent API
230
+ * @inheritdoc
269
231
  */
270
232
  endOfMinute() {
271
233
  this._value = moment(this._value).endOf('minute');
272
234
  return this;
273
235
  }
274
236
  /**
275
- * Add minutes, if count not specified adds 1 minute
276
- * @param count - Number of minutes count
277
- * @returns Itself for fluent API
237
+ * @inheritdoc
278
238
  */
279
239
  addMinutes(count) {
280
240
  this._value = moment(this._value).add(count ?? 1, 'minutes');
281
241
  return this;
282
242
  }
283
243
  /**
284
- * Subtract minutes, if count not specified subtract 1 minute
285
- * @param count - Number of minutes count
286
- * @returns Itself for fluent API
244
+ * @inheritdoc
287
245
  */
288
246
  subtractMinutes(count) {
289
247
  this._value = moment(this._value).subtract(count ?? 1, 'minutes');
290
248
  return this;
291
249
  }
292
250
  /**
293
- * Gets number of days in month
251
+ * @inheritdoc
294
252
  */
295
253
  daysInMonth() {
296
254
  return this._value.daysInMonth();
297
255
  }
298
- /**
299
- * Gets or sets year
300
- * @param year - If specified, sets year
301
- */
302
256
  year(year) {
303
257
  if (isPresent(year)) {
304
258
  this._value = moment(this._value).year(year);
@@ -306,10 +260,6 @@ export class MomentDateApiObject {
306
260
  }
307
261
  return this._value.year();
308
262
  }
309
- /**
310
- * Gets or sets month
311
- * @param month - If specified, sets month
312
- */
313
263
  month(month) {
314
264
  if (isPresent(month)) {
315
265
  this._value = moment(this._value).month(month);
@@ -317,10 +267,6 @@ export class MomentDateApiObject {
317
267
  }
318
268
  return this._value.month();
319
269
  }
320
- /**
321
- * Gets or sets day of month one based
322
- * @param day - If specified, sets day of month
323
- */
324
270
  dayOfMonth(day) {
325
271
  if (isPresent(day)) {
326
272
  this._value = moment(this._value).date(day);
@@ -328,10 +274,6 @@ export class MomentDateApiObject {
328
274
  }
329
275
  return this._value.date();
330
276
  }
331
- /**
332
- * Gets or sets day of week zero based, first is monday
333
- * @param day - If specified, sets day of week
334
- */
335
277
  dayOfWeek(day) {
336
278
  if (isPresent(day)) {
337
279
  this._value = moment(this._value).weekday(day);
@@ -339,10 +281,6 @@ export class MomentDateApiObject {
339
281
  }
340
282
  return this._value.weekday();
341
283
  }
342
- /**
343
- * Gets or sets hours zero
344
- * @param hour - If specified, sets hour
345
- */
346
284
  hour(hour) {
347
285
  if (isPresent(hour)) {
348
286
  this._value = moment(this._value).hours(hour);
@@ -350,10 +288,6 @@ export class MomentDateApiObject {
350
288
  }
351
289
  return this._value.hours();
352
290
  }
353
- /**
354
- * Gets or sets minutes zero based
355
- * @param minute - If specified, sets minutes
356
- */
357
291
  minute(minute) {
358
292
  if (isPresent(minute)) {
359
293
  this._value = moment(this._value).minutes(minute);
@@ -362,40 +296,35 @@ export class MomentDateApiObject {
362
296
  return this._value.minutes();
363
297
  }
364
298
  /**
365
- * Gets indication whether current value is before 'date'
366
- * @param date - Date which is this date compared to
299
+ * @inheritdoc
367
300
  */
368
301
  isBefore(date) {
369
302
  date = this.getDate(date);
370
303
  return this._value.isBefore(date);
371
304
  }
372
305
  /**
373
- * Gets indication whether current value is after 'date'
374
- * @param date - Date which is this date compared to
306
+ * @inheritdoc
375
307
  */
376
308
  isAfter(date) {
377
309
  date = this.getDate(date);
378
310
  return this._value.isAfter(date);
379
311
  }
380
312
  /**
381
- * Gets number of days between this and provided date
382
- * @param date - Date which is used for computation of diff against
313
+ * @inheritdoc
383
314
  */
384
315
  diffDays(date) {
385
316
  date = this.getDate(date);
386
317
  return moment(this._value).startOf('day').diff(moment(date).startOf('day'), 'days');
387
318
  }
388
319
  /**
389
- * Compares whether this date is same week as provided date
390
- * @param date - Date which is used for comparison of same week
320
+ * @inheritdoc
391
321
  */
392
322
  isSameWeek(date) {
393
323
  date = this.getDate(date);
394
324
  return this._value.isSame(date, 'week');
395
325
  }
396
326
  /**
397
- * Compares whether this date is same decade as provided date
398
- * @param date - Date which is used for comparison of same decade
327
+ * @inheritdoc
399
328
  */
400
329
  isSameDecade(date) {
401
330
  date = this.getDate(date);
@@ -405,24 +334,21 @@ export class MomentDateApiObject {
405
334
  return date.year() >= start && date.year() < end;
406
335
  }
407
336
  /**
408
- * Compares whether this date is same year as provided date
409
- * @param date - Date which is used for comparison of same year
337
+ * @inheritdoc
410
338
  */
411
339
  isSameYear(date) {
412
340
  date = this.getDate(date);
413
341
  return this._value.isSame(date, 'year');
414
342
  }
415
343
  /**
416
- * Compares whether this date is same month as provided date
417
- * @param date - Date which is used for comparison of same month
344
+ * @inheritdoc
418
345
  */
419
346
  isSameMonth(date) {
420
347
  date = this.getDate(date);
421
348
  return this._value.isSame(date, 'month');
422
349
  }
423
350
  /**
424
- * Compares whether this date is same day as provided date
425
- * @param date - Date which is used for comparison of same day
351
+ * @inheritdoc
426
352
  */
427
353
  isSameDay(date) {
428
354
  date = this.getDate(date);
@@ -436,21 +362,19 @@ export class MomentDateApiObject {
436
362
  return this._value.isSame(date);
437
363
  }
438
364
  /**
439
- * Creates clone of this instance, value and originalValue have same value and are cloned from value
365
+ * @inheritdoc
440
366
  */
441
367
  clone() {
442
368
  return new MomentDateApiObject(moment(this._value));
443
369
  }
444
370
  /**
445
- * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue
371
+ * @inheritdoc
446
372
  */
447
373
  cloneOriginal() {
448
374
  return new MomentDateApiObject(moment(this._originalValue));
449
375
  }
450
376
  /**
451
- * Updates originalValue, if value is not provided originalValue is set to value
452
- * @param value - Value to be set as original, or null (value will be used as value)
453
- * @returns Itself for fluent API
377
+ * @inheritdoc
454
378
  */
455
379
  updateOriginal(value) {
456
380
  if (isBlank(value)) {
@@ -462,8 +386,7 @@ export class MomentDateApiObject {
462
386
  return this;
463
387
  }
464
388
  /**
465
- * Changes value to same value as originalValue
466
- * @returns Itself for fluent API
389
+ * @inheritdoc
467
390
  */
468
391
  resetOriginal() {
469
392
  this._value = this._originalValue;
@@ -485,8 +408,6 @@ export class MomentDateApiObject {
485
408
  * Date api using MomentJS, used for obtaining DateApi wrapper object
486
409
  */
487
410
  export class MomentDateApi {
488
- _relativeParser;
489
- _dateApiObjecType;
490
411
  //######################### constructor #########################
491
412
  constructor(_relativeParser, _dateApiObjecType) {
492
413
  this._relativeParser = _relativeParser;
@@ -494,22 +415,19 @@ export class MomentDateApi {
494
415
  }
495
416
  //######################### public methods #########################
496
417
  /**
497
- * Gets wrapping object used for manipulation
498
- * @param value - Value to be converted (parsed) and used for manipulation
499
- * @param format - Format string used for parsing string value
418
+ * @inheritdoc
500
419
  */
501
420
  getValue(value, format) {
502
421
  return new this._dateApiObjecType(this._relativeParser.parse(value), format);
503
422
  }
504
423
  /**
505
- * Gets wrapping object used for manipulation instantiated to current date and time
424
+ * @inheritdoc
506
425
  */
507
426
  now() {
508
427
  return new this._dateApiObjecType(moment());
509
428
  }
510
429
  /**
511
- * Gets format string using pseudo format
512
- * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string
430
+ * @inheritdoc
513
431
  */
514
432
  getFormat(pseudoFormat) {
515
433
  if (/^((LT|LTS|L+|l+)\s*)*$/g.test(pseudoFormat)) {
@@ -518,13 +436,19 @@ export class MomentDateApi {
518
436
  return pseudoFormat;
519
437
  }
520
438
  /**
521
- * Gets information
439
+ * @inheritdoc
522
440
  */
523
441
  weekStartsOnMonday() {
524
442
  return moment.localeData().firstDayOfWeek() === 1;
525
443
  }
526
444
  /**
527
- * Gets array of weekday names in short format, order of days is dependent on locale
445
+ * @inheritdoc
446
+ */
447
+ weekdays(short) {
448
+ return short ? moment.weekdaysShort(true) : moment.weekdays(true);
449
+ }
450
+ /**
451
+ * @inheritdoc
528
452
  */
529
453
  weekdaysShort() {
530
454
  return moment.weekdaysShort(true);
@@ -535,10 +459,10 @@ export class MomentDateApi {
535
459
  isDate(value) {
536
460
  return value instanceof moment;
537
461
  }
538
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MomentDateApi, deps: [{ token: i1.DateTimeRelativeParser }, { token: DATE_API_OBJECT_TYPE }], target: i0.ɵɵFactoryTarget.Injectable });
539
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MomentDateApi });
462
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MomentDateApi, deps: [{ token: i1.DateTimeRelativeParser }, { token: DATE_API_OBJECT_TYPE }], target: i0.ɵɵFactoryTarget.Injectable }); }
463
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MomentDateApi }); }
540
464
  }
541
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: MomentDateApi, decorators: [{
465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.7", ngImport: i0, type: MomentDateApi, decorators: [{
542
466
  type: Injectable
543
467
  }], ctorParameters: () => [{ type: i1.DateTimeRelativeParser }, { type: undefined, decorators: [{
544
468
  type: Inject,