@anglr/datetime 8.1.0-beta.20240704065846 → 8.1.0-beta.20240704075145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,11 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 8.1.0 (2024-07-04)
4
+
5
+ ### Features
6
+
7
+ - updated `DateApiObject` interface
8
+ - **new methods**
9
+ - `timestamp` gets value of date time as timestamp (in miliseconds)
10
+ - *subpackage* `@anglr/datetime/moment`
11
+ - updated `MomentDateApi`
12
+ - now implements also new `timestamp`
13
+ - *subpackage* `@anglr/datetime/date-fns`
14
+ - updated `DateFnsDateApi`
15
+ - now implements also new `timestamp`
16
+
17
+ ## Version 8.0.2 (2024-07-04)
18
+
19
+ ### Bug Fixes
20
+
21
+ - fixed bug with using *datetime* value format `UnixTimestamp`, incorrectly returned value as *DateTime*
22
+
3
23
  ## Version 8.0.1 (2024-07-04)
4
24
 
5
25
  ### Bug Fixes
6
26
 
7
27
  - fixed bug with parsing user input for `DataString` value format
8
- - fixed bug with not working `UnixTimestamp` value format
9
28
 
10
29
  ## Version 8.0.0 (2024-01-25)
11
30
 
@@ -46,128 +46,99 @@ export declare class DateFnsDateApiObject implements DateApiObject<Date> {
46
46
  */
47
47
  unixTimestamp(): number;
48
48
  /**
49
- * Updates value to start date and time of current decade
50
- * @returns Itself for fluent API
49
+ * @inheritdoc
50
+ */
51
+ timestamp(): number;
52
+ /**
53
+ * @inheritdoc
51
54
  */
52
55
  startOfDecade(): DateApiObject<Date>;
53
56
  /**
54
- * Updates value to end date and time of current decade
55
- * @returns Itself for fluent API
57
+ * @inheritdoc
56
58
  */
57
59
  endOfDecade(): DateApiObject<Date>;
58
60
  /**
59
- * Updates value to start date and time of current year
60
- * @returns Itself for fluent API
61
+ * @inheritdoc
61
62
  */
62
63
  startOfYear(): DateApiObject<Date>;
63
64
  /**
64
- * Updates value to end date and time of current year
65
- * @returns Itself for fluent API
65
+ * @inheritdoc
66
66
  */
67
67
  endOfYear(): DateApiObject<Date>;
68
68
  /**
69
- * Add years, if count not specified adds 1 year
70
- * @param count - Number of years count
71
- * @returns Itself for fluent API
69
+ * @inheritdoc
72
70
  */
73
71
  addYears(count?: number): DateApiObject<Date>;
74
72
  /**
75
- * Subtract years, if count not specified subtract 1 year
76
- * @param count - Number of years count
77
- * @returns Itself for fluent API
73
+ * @inheritdoc
78
74
  */
79
75
  subtractYears(count?: number): DateApiObject<Date>;
80
76
  /**
81
- * Updates value to start date and time of current month
82
- * @returns Itself for fluent API
77
+ * @inheritdoc
83
78
  */
84
79
  startOfMonth(): DateApiObject<Date>;
85
80
  /**
86
- * Updates value to end date and time of current month
87
- * @returns Itself for fluent API
81
+ * @inheritdoc
88
82
  */
89
83
  endOfMonth(): DateApiObject<Date>;
90
84
  /**
91
- * Add months, if count not specified adds 1 month
92
- * @param count - Number of months count
93
- * @returns Itself for fluent API
85
+ * @inheritdoc
94
86
  */
95
87
  addMonths(count?: number): DateApiObject<Date>;
96
88
  /**
97
- * Subtract months, if count not specified subtract 1 month
98
- * @param count - Number of months count
99
- * @returns Itself for fluent API
89
+ * @inheritdoc
100
90
  */
101
91
  subtractMonths(count?: number): DateApiObject<Date>;
102
92
  /**
103
- * Updates value to start date and time of current week
104
- * @returns Itself for fluent API
93
+ * @inheritdoc
105
94
  */
106
95
  startOfWeek(): DateApiObject<Date>;
107
96
  /**
108
- * Updates value to end date and time of current week
109
- * @returns Itself for fluent API
97
+ * @inheritdoc
110
98
  */
111
99
  endOfWeek(): DateApiObject<Date>;
112
100
  /**
113
- * Add weeks, if count not specified adds 1 week
114
- * @param count - Number of weeks count
115
- * @returns Itself for fluent API
101
+ * @inheritdoc
116
102
  */
117
103
  addWeeks(count?: number): DateApiObject<Date>;
118
104
  /**
119
- * Subtract weeks, if count not specified subtract 1 week
120
- * @param count - Number of weeks count
121
- * @returns Itself for fluent API
105
+ * @inheritdoc
122
106
  */
123
107
  subtractWeeks(count?: number): DateApiObject<Date>;
124
108
  /**
125
- * Updates value to start date and time of current day
126
- * @returns Itself for fluent API
109
+ * @inheritdoc
127
110
  */
128
111
  startOfDay(): DateApiObject<Date>;
129
112
  /**
130
- * Updates value to end date and time of current day
131
- * @returns Itself for fluent API
113
+ * @inheritdoc
132
114
  */
133
115
  endOfDay(): DateApiObject<Date>;
134
116
  /**
135
- * Add days, if count not specified adds 1 day
136
- * @param count - Number of days count
137
- * @returns Itself for fluent API
117
+ * @inheritdoc
138
118
  */
139
119
  addDays(count?: number): DateApiObject<Date>;
140
120
  /**
141
- * Subtract days, if count not specified subtract 1 day
142
- * @param count - Number of days count
143
- * @returns Itself for fluent API
121
+ * @inheritdoc
144
122
  */
145
123
  subtractDays(count?: number): DateApiObject<Date>;
146
124
  /**
147
- * Updates value to start date and time of current hour
148
- * @returns Itself for fluent API
125
+ * @inheritdoc
149
126
  */
150
127
  startOfHour(): DateApiObject<Date>;
151
128
  /**
152
- * Updates value to end date and time of current hour
153
- * @returns Itself for fluent API
129
+ * @inheritdoc
154
130
  */
155
131
  endOfHour(): DateApiObject<Date>;
156
132
  /**
157
- * Add hours, if count not specified adds 1 hour
158
- * @param count - Number of hours count
159
- * @returns Itself for fluent API
133
+ * @inheritdoc
160
134
  */
161
135
  addHours(count?: number): DateApiObject<Date>;
162
136
  /**
163
- * Subtract hours, if count not specified subtract 1 hour
164
- * @param count - Number of hours count
165
- * @returns Itself for fluent API
137
+ * @inheritdoc
166
138
  */
167
139
  subtractHours(count?: number): DateApiObject<Date>;
168
140
  /**
169
- * Updates value to start date and time of current minute
170
- * @returns Itself for fluent API
141
+ * @inheritdoc
171
142
  */
172
143
  startOfMinute(): DateApiObject<Date>;
173
144
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"dateFnsDateApi.service.d.ts","sourceRoot":"","sources":["dateFnsDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EA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import { isBlank, isPresent, isString } from '@jscrpt/common';
4
- import { toDate, getDate, setDate, isAfter, isBefore, isEqual, differenceInCalendarDays, format, formatISO, 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, getUnixTime } from 'date-fns';
4
+ import { toDate, getDate, setDate, isAfter, isBefore, isEqual, differenceInCalendarDays, format, formatISO, 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, getUnixTime, getTime } 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";
@@ -84,194 +84,167 @@ export class DateFnsDateApiObject {
84
84
  return getUnixTime(this._value);
85
85
  }
86
86
  /**
87
- * Updates value to start date and time of current decade
88
- * @returns Itself for fluent API
87
+ * @inheritdoc
88
+ */
89
+ timestamp() {
90
+ return getTime(this._value);
91
+ }
92
+ /**
93
+ * @inheritdoc
89
94
  */
90
95
  startOfDecade() {
91
96
  this._value = startOfDecade(this._value);
92
97
  return this;
93
98
  }
94
99
  /**
95
- * Updates value to end date and time of current decade
96
- * @returns Itself for fluent API
100
+ * @inheritdoc
97
101
  */
98
102
  endOfDecade() {
99
103
  this._value = endOfDecade(this._value);
100
104
  return this;
101
105
  }
102
106
  /**
103
- * Updates value to start date and time of current year
104
- * @returns Itself for fluent API
107
+ * @inheritdoc
105
108
  */
106
109
  startOfYear() {
107
110
  this._value = startOfYear(this._value);
108
111
  return this;
109
112
  }
110
113
  /**
111
- * Updates value to end date and time of current year
112
- * @returns Itself for fluent API
114
+ * @inheritdoc
113
115
  */
114
116
  endOfYear() {
115
117
  this._value = endOfYear(this._value);
116
118
  return this;
117
119
  }
118
120
  /**
119
- * Add years, if count not specified adds 1 year
120
- * @param count - Number of years count
121
- * @returns Itself for fluent API
121
+ * @inheritdoc
122
122
  */
123
123
  addYears(count) {
124
124
  this._value = addYears(this._value, count ?? 1);
125
125
  return this;
126
126
  }
127
127
  /**
128
- * Subtract years, if count not specified subtract 1 year
129
- * @param count - Number of years count
130
- * @returns Itself for fluent API
128
+ * @inheritdoc
131
129
  */
132
130
  subtractYears(count) {
133
131
  this._value = subYears(this._value, count ?? 1);
134
132
  return this;
135
133
  }
136
134
  /**
137
- * Updates value to start date and time of current month
138
- * @returns Itself for fluent API
135
+ * @inheritdoc
139
136
  */
140
137
  startOfMonth() {
141
138
  this._value = startOfMonth(this._value);
142
139
  return this;
143
140
  }
144
141
  /**
145
- * Updates value to end date and time of current month
146
- * @returns Itself for fluent API
142
+ * @inheritdoc
147
143
  */
148
144
  endOfMonth() {
149
145
  this._value = endOfMonth(this._value);
150
146
  return this;
151
147
  }
152
148
  /**
153
- * Add months, if count not specified adds 1 month
154
- * @param count - Number of months count
155
- * @returns Itself for fluent API
149
+ * @inheritdoc
156
150
  */
157
151
  addMonths(count) {
158
152
  this._value = addMonths(this._value, count ?? 1);
159
153
  return this;
160
154
  }
161
155
  /**
162
- * Subtract months, if count not specified subtract 1 month
163
- * @param count - Number of months count
164
- * @returns Itself for fluent API
156
+ * @inheritdoc
165
157
  */
166
158
  subtractMonths(count) {
167
159
  this._value = subMonths(this._value, count ?? 1);
168
160
  return this;
169
161
  }
170
162
  /**
171
- * Updates value to start date and time of current week
172
- * @returns Itself for fluent API
163
+ * @inheritdoc
173
164
  */
174
165
  startOfWeek() {
175
166
  this._value = startOfWeek(this._value, { locale: this._localeSvc.locale });
176
167
  return this;
177
168
  }
178
169
  /**
179
- * Updates value to end date and time of current week
180
- * @returns Itself for fluent API
170
+ * @inheritdoc
181
171
  */
182
172
  endOfWeek() {
183
173
  this._value = endOfWeek(this._value, { locale: this._localeSvc.locale });
184
174
  return this;
185
175
  }
186
176
  /**
187
- * Add weeks, if count not specified adds 1 week
188
- * @param count - Number of weeks count
189
- * @returns Itself for fluent API
177
+ * @inheritdoc
190
178
  */
191
179
  addWeeks(count) {
192
180
  this._value = addWeeks(this._value, count ?? 1);
193
181
  return this;
194
182
  }
195
183
  /**
196
- * Subtract weeks, if count not specified subtract 1 week
197
- * @param count - Number of weeks count
198
- * @returns Itself for fluent API
184
+ * @inheritdoc
199
185
  */
200
186
  subtractWeeks(count) {
201
187
  this._value = subWeeks(this._value, count ?? 1);
202
188
  return this;
203
189
  }
204
190
  /**
205
- * Updates value to start date and time of current day
206
- * @returns Itself for fluent API
191
+ * @inheritdoc
207
192
  */
208
193
  startOfDay() {
209
194
  this._value = startOfDay(this._value);
210
195
  return this;
211
196
  }
212
197
  /**
213
- * Updates value to end date and time of current day
214
- * @returns Itself for fluent API
198
+ * @inheritdoc
215
199
  */
216
200
  endOfDay() {
217
201
  this._value = endOfDay(this._value);
218
202
  return this;
219
203
  }
220
204
  /**
221
- * Add days, if count not specified adds 1 day
222
- * @param count - Number of days count
223
- * @returns Itself for fluent API
205
+ * @inheritdoc
224
206
  */
225
207
  addDays(count) {
226
208
  this._value = addDays(this._value, count ?? 1);
227
209
  return this;
228
210
  }
229
211
  /**
230
- * Subtract days, if count not specified subtract 1 day
231
- * @param count - Number of days count
232
- * @returns Itself for fluent API
212
+ * @inheritdoc
233
213
  */
234
214
  subtractDays(count) {
235
215
  this._value = subDays(this._value, count ?? 1);
236
216
  return this;
237
217
  }
238
218
  /**
239
- * Updates value to start date and time of current hour
240
- * @returns Itself for fluent API
219
+ * @inheritdoc
241
220
  */
242
221
  startOfHour() {
243
222
  this._value = startOfHour(this._value);
244
223
  return this;
245
224
  }
246
225
  /**
247
- * Updates value to end date and time of current hour
248
- * @returns Itself for fluent API
226
+ * @inheritdoc
249
227
  */
250
228
  endOfHour() {
251
229
  this._value = endOfHour(this._value);
252
230
  return this;
253
231
  }
254
232
  /**
255
- * Add hours, if count not specified adds 1 hour
256
- * @param count - Number of hours count
257
- * @returns Itself for fluent API
233
+ * @inheritdoc
258
234
  */
259
235
  addHours(count) {
260
236
  this._value = addHours(this._value, count ?? 1);
261
237
  return this;
262
238
  }
263
239
  /**
264
- * Subtract hours, if count not specified subtract 1 hour
265
- * @param count - Number of hours count
266
- * @returns Itself for fluent API
240
+ * @inheritdoc
267
241
  */
268
242
  subtractHours(count) {
269
243
  this._value = subHours(this._value, count ?? 1);
270
244
  return this;
271
245
  }
272
246
  /**
273
- * Updates value to start date and time of current minute
274
- * @returns Itself for fluent API
247
+ * @inheritdoc
275
248
  */
276
249
  startOfMinute() {
277
250
  this._value = startOfMinute(this._value);
@@ -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,EAAgB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAa,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,E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Q,EAAE,wBAAwB;CACrC,CAAC","sourcesContent":["import {Inject, Injectable, ValueProvider} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE, DateObject} from '@anglr/datetime';\nimport {isBlank, isPresent, isString} from '@jscrpt/common';\nimport {toDate, getDate, setDate, isAfter, isBefore, isEqual, differenceInCalendarDays, format, formatISO, 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, getUnixTime} from 'date-fns';\n\nimport {DATE_FNS_LOCALE} from '../misc/tokens';\nimport {DateFnsLocale} from './dateFnsLocale.service';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: Date;\n\n /**\n * Instance of date\n */\n protected _value: Date;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): Date\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): Date\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|Date,\n format: string|null|undefined,\n protected _localeSvc: DateFnsLocale)\n {\n if(isString(value))\n {\n //ISO string\n if(/^\\d+-\\d+-\\d+(T\\d+:\\d+:\\d+)?/.test(value))\n {\n this._value = this._originalValue = parseISO(value);\n }\n else\n {\n if(isBlank(format))\n {\n throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');\n }\n\n this._value = this._originalValue = parse(value, format, new Date(1970, 0));\n }\n }\n else\n {\n this._value = this._originalValue = toDate(value);\n }\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return isValid(this._value);\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n return isWeekend(this._value);\n }\n\n /**\n * Formats date value\n * @param formatString - Format token used for creating formatted string\n */\n public format(formatString: string): string\n {\n return format(this._value, formatString, {locale: this._localeSvc.locale});\n }\n\n /**\n * @inheritdoc\n */\n public formatISO(): string\n {\n return formatISO(this._value);\n }\n\n /**\n * @inheritdoc\n */\n public unixTimestamp(): number\n {\n return getUnixTime(this._value);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): number\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameMonth(this._value, date);\n }\n\n /**\n * @inheritdoc\n */\n public isSameDay(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameDay(this._value, date);\n }\n\n /**\n * @inheritdoc\n */\n public isSame(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isEqual(this._value, date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._value), null, this._localeSvc);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._originalValue), null, this._localeSvc);\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: Date): DateApiObject<Date>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<Date>\n {\n this._value = this._originalValue;\n\n return this;\n }\n\n //######################### protected methods #########################\n\n /**\n * Converts date object to date\n * @param value - Value to be converted to date\n */\n protected getDate(value: DateObject<Date>): Date\n {\n if(value instanceof Date)\n {\n return value;\n }\n\n return value.value;\n }\n}\n\n/**\n * Date api using DateFnsJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class DateFnsDateApi implements DateApi<Date>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_FNS_LOCALE) protected _localeSvc: DateFnsLocale,\n protected _relativeParser: DateTimeRelativeParser<Date>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<Date, DateFnsDateApiObject>)\n {\n }\n\n //######################### public methods - implementation of DateApi #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|Date, format?: string): DateApiObject<Date>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format, this._localeSvc);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<Date>\n {\n return new this._dateApiObjecType(new Date(), null ?? undefined, this._localeSvc);\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^p+$/i.test(pseudoFormat))\n {\n if(!this._localeSvc.locale.formatLong)\n {\n throw new Error('Missing long formats for locale in DateApi');\n }\n\n const widths: {[index: number]: string} =\n {\n 1: 'short',\n 2: 'medium',\n 3: 'long',\n 4: 'full'\n };\n\n //date time format\n if(pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8)\n {\n const partLength = pseudoFormat.length / 2;\n\n return `${this._localeSvc.locale.formatLong.date({width: widths[partLength]})} ${this._localeSvc.locale.formatLong.time({width: widths[partLength]})}`;\n }\n //date format\n else if(pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.date({width: widths[pseudoFormat.length]});\n }\n //time format\n else if(pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.time({width: widths[pseudoFormat.length]});\n }\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information\n */\n public weekStartsOnMonday(): boolean\n {\n return this._localeSvc.locale.options?.weekStartsOn === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n let startIndex = this._localeSvc.locale.options!.weekStartsOn!;\n const weekdays: string[] = [];\n\n for(let x = 0; x < 7; x++)\n {\n weekdays.push(this._localeSvc.locale.localize!.day(startIndex++ % 7, {width: 'short'}));\n }\n\n return weekdays;\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is Date\n {\n return isDate(value);\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for date-fns\n */\nexport const dateFnsDateApiObjectType: DateApiObjectCtor<Date, DateFnsDateApiObject> = DateFnsDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for date-fns\n */\nexport const DATE_FNS_DATE_API_OBJECT_TYPE: ValueProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useValue: dateFnsDateApiObjectType\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,EAAgB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAa,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,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B,IAAI,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAQ,CAAC,YAAa,CAAC;QAC/D,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EACzB;YACI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAS,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC,CAAC,CAAC;SAC3F;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAc;QAExB,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;uGAtGQ,cAAc,kBAGH,eAAe,mDAEf,oBAAoB;2GAL/B,cAAc;;2FAAd,cAAc;kBAD1B,UAAU;;0BAIM,MAAM;2BAAC,eAAe;;0BAEtB,MAAM;2BAAC,oBAAoB;;AAoG5C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAkD,oBAAoB,CAAC;AAE5G;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAC1C;IACI,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,wBAAwB;CACrC,CAAC","sourcesContent":["import {Inject, Injectable, ValueProvider} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE, DateObject} from '@anglr/datetime';\nimport {isBlank, isPresent, isString} from '@jscrpt/common';\nimport {toDate, getDate, setDate, isAfter, isBefore, isEqual, differenceInCalendarDays, format, formatISO, 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, getUnixTime, getTime} from 'date-fns';\n\nimport {DATE_FNS_LOCALE} from '../misc/tokens';\nimport {DateFnsLocale} from './dateFnsLocale.service';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class DateFnsDateApiObject implements DateApiObject<Date>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: Date;\n\n /**\n * Instance of date\n */\n protected _value: Date;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): Date\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): Date\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|Date,\n format: string|null|undefined,\n protected _localeSvc: DateFnsLocale)\n {\n if(isString(value))\n {\n //ISO string\n if(/^\\d+-\\d+-\\d+(T\\d+:\\d+:\\d+)?/.test(value))\n {\n this._value = this._originalValue = parseISO(value);\n }\n else\n {\n if(isBlank(format))\n {\n throw new Error('date-fns requires format parameter to be set for parsing non ISO string date!');\n }\n\n this._value = this._originalValue = parse(value, format, new Date(1970, 0));\n }\n }\n else\n {\n this._value = this._originalValue = toDate(value);\n }\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return isValid(this._value);\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n return isWeekend(this._value);\n }\n\n /**\n * Formats date value\n * @param formatString - Format token used for creating formatted string\n */\n public format(formatString: string): string\n {\n return format(this._value, formatString, {locale: this._localeSvc.locale});\n }\n\n /**\n * @inheritdoc\n */\n public formatISO(): string\n {\n return formatISO(this._value);\n }\n\n /**\n * @inheritdoc\n */\n public unixTimestamp(): number\n {\n return getUnixTime(this._value);\n }\n\n /**\n * @inheritdoc\n */\n public timestamp(): number\n {\n return getTime(this._value);\n }\n\n /**\n * @inheritdoc\n */\n public startOfDecade(): DateApiObject<Date>\n {\n this._value = startOfDecade(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public endOfDecade(): DateApiObject<Date>\n {\n this._value = endOfDecade(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public startOfYear(): DateApiObject<Date>\n {\n this._value = startOfYear(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public endOfYear(): DateApiObject<Date>\n {\n this._value = endOfYear(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\n */\n public startOfMonth(): DateApiObject<Date>\n {\n this._value = startOfMonth(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public endOfMonth(): DateApiObject<Date>\n {\n this._value = endOfMonth(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\n */\n public startOfDay(): DateApiObject<Date>\n {\n this._value = startOfDay(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public endOfDay(): DateApiObject<Date>\n {\n this._value = endOfDay(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\n */\n public startOfHour(): DateApiObject<Date>\n {\n this._value = startOfHour(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public endOfHour(): DateApiObject<Date>\n {\n this._value = endOfHour(this._value);\n\n return this;\n }\n\n /**\n * @inheritdoc\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 * @inheritdoc\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 * @inheritdoc\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): number\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\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: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameMonth(this._value, date);\n }\n\n /**\n * @inheritdoc\n */\n public isSameDay(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isSameDay(this._value, date);\n }\n\n /**\n * @inheritdoc\n */\n public isSame(date: DateObject<Date>): boolean\n {\n date = this.getDate(date);\n\n return isEqual(this._value, date);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n public clone(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._value), null, this._localeSvc);\n }\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n public cloneOriginal(): DateApiObject<Date>\n {\n return new DateFnsDateApiObject(new Date(this._originalValue), null, this._localeSvc);\n }\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n public updateOriginal(value?: Date): DateApiObject<Date>\n {\n if(isBlank(value))\n {\n this._originalValue = this._value;\n }\n else\n {\n this._value = this._originalValue = value;\n }\n\n return this;\n }\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n public resetOriginal(): DateApiObject<Date>\n {\n this._value = this._originalValue;\n\n return this;\n }\n\n //######################### protected methods #########################\n\n /**\n * Converts date object to date\n * @param value - Value to be converted to date\n */\n protected getDate(value: DateObject<Date>): Date\n {\n if(value instanceof Date)\n {\n return value;\n }\n\n return value.value;\n }\n}\n\n/**\n * Date api using DateFnsJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class DateFnsDateApi implements DateApi<Date>\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_FNS_LOCALE) protected _localeSvc: DateFnsLocale,\n protected _relativeParser: DateTimeRelativeParser<Date>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<Date, DateFnsDateApiObject>)\n {\n }\n\n //######################### public methods - implementation of DateApi #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|Date, format?: string): DateApiObject<Date>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format, this._localeSvc);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<Date>\n {\n return new this._dateApiObjecType(new Date(), null ?? undefined, this._localeSvc);\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^p+$/i.test(pseudoFormat))\n {\n if(!this._localeSvc.locale.formatLong)\n {\n throw new Error('Missing long formats for locale in DateApi');\n }\n\n const widths: {[index: number]: string} =\n {\n 1: 'short',\n 2: 'medium',\n 3: 'long',\n 4: 'full'\n };\n\n //date time format\n if(pseudoFormat.indexOf('Pp') >= 0 && pseudoFormat.length <= 8)\n {\n const partLength = pseudoFormat.length / 2;\n\n return `${this._localeSvc.locale.formatLong.date({width: widths[partLength]})} ${this._localeSvc.locale.formatLong.time({width: widths[partLength]})}`;\n }\n //date format\n else if(pseudoFormat.indexOf('P') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.date({width: widths[pseudoFormat.length]});\n }\n //time format\n else if(pseudoFormat.indexOf('p') >= 0 && pseudoFormat.length <= 4)\n {\n return this._localeSvc.locale.formatLong.time({width: widths[pseudoFormat.length]});\n }\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information\n */\n public weekStartsOnMonday(): boolean\n {\n return this._localeSvc.locale.options?.weekStartsOn === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n let startIndex = this._localeSvc.locale.options!.weekStartsOn!;\n const weekdays: string[] = [];\n\n for(let x = 0; x < 7; x++)\n {\n weekdays.push(this._localeSvc.locale.localize!.day(startIndex++ % 7, {width: 'short'}));\n }\n\n return weekdays;\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is Date\n {\n return isDate(value);\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for date-fns\n */\nexport const dateFnsDateApiObjectType: DateApiObjectCtor<Date, DateFnsDateApiObject> = DateFnsDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for date-fns\n */\nexport const DATE_FNS_DATE_API_OBJECT_TYPE: ValueProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useValue: dateFnsDateApiObjectType\n};"]}
@@ -67,6 +67,12 @@ export class MomentDateApiObject {
67
67
  unixTimestamp() {
68
68
  return this._value.unix();
69
69
  }
70
+ /**
71
+ * @inheritdoc
72
+ */
73
+ timestamp() {
74
+ return this._value.valueOf();
75
+ }
70
76
  /**
71
77
  * Updates value to start date and time of current decade
72
78
  * @returns Itself for fluent API
@@ -1 +1 @@
1
- {"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAa,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAE5B,sEAAsE;IAEtE;;OAEG;IACO,cAAc,CAAgB;IAExC;;OAEG;IACO,MAAM,CAAgB;IAEhC,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;I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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;uGAhEQ,aAAa,wDAIF,oBAAoB;2GAJ/B,aAAa;;2FAAb,aAAa;kBADzB,UAAU;;0BAKM,MAAM;2BAAC,oBAAoB;;AA+D5C;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA0D,mBAAmB,CAAC;AAElH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACxC;IACI,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,uBAAuB;CACpC,CAAC","sourcesContent":["import {Inject, Injectable, ValueProvider} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE, DateObject} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n protected _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * @inheritdoc\n */\n public formatISO(): string\n {\n return this._value.format();\n }\n\n /**\n * @inheritdoc\n */\n public unixTimestamp(): number\n {\n return this._value.unix();\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): number\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(date, 'day');\n }\n\n /**\n * @inheritdoc\n */\n public isSame(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(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<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 //######################### protected methods #########################\n\n /**\n * Converts date object to date\n * @param value - Value to be converted to date\n */\n protected getDate(value: DateObject<moment.Moment>): moment.Moment\n {\n if(value instanceof moment)\n {\n return value as moment.Moment;\n }\n\n return (value as DateApiObject<moment.Moment>).value;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<moment.Moment, MomentDateApiObject>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for moment\n */\nexport const momentDateApiObjectType: DateApiObjectCtor<moment.Moment, MomentDateApiObject> = MomentDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for moment\n */\nexport const MOMENT_DATE_API_OBJECT_TYPE: ValueProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useValue: momentDateApiObjectType\n};\n"]}
1
+ {"version":3,"file":"momentDateApi.service.js","sourceRoot":"","sources":["../../../../moment/src/services/momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AAChE,OAAO,EAAoC,sBAAsB,EAAqB,oBAAoB,EAAa,MAAM,iBAAiB,CAAC;AAC/I,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAClD,OAAO,MAA2B,MAAM,QAAQ,CAAC;;;AAEjD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAE5B,sEAAsE;IAEtE;;OAEG;IACO,cAAc,CAAgB;IAExC;;OAEG;IACO,MAAM,CAAgB;IAEhC,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;IAED,iEAAiE;IACjE,YAAY,KAA8B,EAAE,MAAe;QAEvD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;IAED,sGAAsG;IAEtG;;OAEG;IACI,OAAO;QAEV,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,SAAS;QAEZ,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QAEzC,OAAO,OAAO,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,MAAc;QAExB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO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BAAuB,GAA0D,mBAAmB,CAAC;AAElH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACxC;IACI,OAAO,EAAE,oBAAoB;IAC7B,QAAQ,EAAE,uBAAuB;CACpC,CAAC","sourcesContent":["import {Inject, Injectable, ValueProvider} from '@angular/core';\nimport {DateApi, DateValue, DateApiObject, DateTimeRelativeParser, DateApiObjectCtor, DATE_API_OBJECT_TYPE, DateObject} from '@anglr/datetime';\nimport {isBlank, isPresent} from '@jscrpt/common';\nimport moment, {LongDateFormatKey} from 'moment';\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport class MomentDateApiObject implements DateApiObject<moment.Moment>\n{\n //######################### protected fields #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n protected _originalValue: moment.Moment;\n\n /**\n * Instance of date\n */\n protected _value: moment.Moment;\n\n //######################### public properties - implementation of DateApiObject #########################\n\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n public get originalValue(): moment.Moment\n {\n return this._originalValue;\n }\n\n /**\n * Instance of date\n */\n public get value(): moment.Moment\n {\n return this._value;\n }\n\n //######################### constructor #########################\n constructor(value: DateValue|moment.Moment, format?: string)\n {\n this._value = this._originalValue = moment(value, format);\n }\n\n //######################### public methods - implementation of DateApiObject #########################\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n public isValid(): boolean\n {\n return this._value.isValid();\n }\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n public isWeekend(): boolean\n {\n const weekday = this._value.isoWeekday();\n\n return weekday == 6 || weekday == 7;\n }\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n public format(format: string): string\n {\n return this._value.format(format.replace(/y/g, 'Y').replace(/d/g, 'D'));\n }\n\n /**\n * @inheritdoc\n */\n public formatISO(): string\n {\n return this._value.format();\n }\n\n /**\n * @inheritdoc\n */\n public unixTimestamp(): number\n {\n return this._value.unix();\n }\n\n /**\n * @inheritdoc\n */\n public timestamp(): number\n {\n return this._value.valueOf();\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): number\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\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: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(date, 'day');\n }\n\n /**\n * @inheritdoc\n */\n public isSame(date: DateObject<moment.Moment>): boolean\n {\n date = this.getDate(date);\n\n return this._value.isSame(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<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 //######################### protected methods #########################\n\n /**\n * Converts date object to date\n * @param value - Value to be converted to date\n */\n protected getDate(value: DateObject<moment.Moment>): moment.Moment\n {\n if(value instanceof moment)\n {\n return value as moment.Moment;\n }\n\n return (value as DateApiObject<moment.Moment>).value;\n }\n}\n\n/**\n * Date api using MomentJS, used for obtaining DateApi wrapper object\n */\n@Injectable()\nexport class MomentDateApi implements DateApi<moment.Moment>\n{\n //######################### constructor #########################\n constructor(protected _relativeParser: DateTimeRelativeParser<moment.Moment>,\n @Inject(DATE_API_OBJECT_TYPE) protected _dateApiObjecType: DateApiObjectCtor<moment.Moment, MomentDateApiObject>)\n {\n }\n\n //######################### public methods #########################\n\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n public getValue(value: DateValue|moment.Moment, format?: string): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(this._relativeParser.parse(value), format);\n }\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n public now(): DateApiObject<moment.Moment>\n {\n return new this._dateApiObjecType(moment());\n }\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n public getFormat(pseudoFormat: string): string\n {\n if(/^((LT|LTS|L+|l+)\\s*)*$/g.test(pseudoFormat))\n {\n return pseudoFormat.split(' ').map(itm => moment.localeData().longDateFormat(itm as LongDateFormatKey)).join(' ');\n }\n\n return pseudoFormat;\n }\n\n /**\n * Gets information \n */\n public weekStartsOnMonday(): boolean\n {\n return moment.localeData().firstDayOfWeek() === 1;\n }\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n public weekdaysShort(): string[]\n {\n return moment.weekdaysShort(true);\n }\n\n /**\n * @inheritdoc\n */\n public isDate(value: unknown): value is moment.Moment\n {\n return value instanceof moment;\n }\n}\n\n/**\n * Type that represents creation of DateApiObject for moment\n */\nexport const momentDateApiObjectType: DateApiObjectCtor<moment.Moment, MomentDateApiObject> = MomentDateApiObject;\n\n/**\n * Injection token used for injecting type that creates instance of DateApiObject for moment\n */\nexport const MOMENT_DATE_API_OBJECT_TYPE: ValueProvider =\n{\n provide: DATE_API_OBJECT_TYPE,\n useValue: momentDateApiObjectType\n};\n"]}
@@ -8,20 +8,24 @@ export var DateTimeValueFormat;
8
8
  */
9
9
  DateTimeValueFormat[DateTimeValueFormat["DateInstance"] = 0] = "DateInstance";
10
10
  /**
11
- * Numeric unix timestamp in miliseconds
11
+ * Numeric unix timestamp in seconds (only works for ControlValueAccessor, internally its Timestamp)
12
12
  */
13
13
  DateTimeValueFormat[DateTimeValueFormat["UnixTimestamp"] = 1] = "UnixTimestamp";
14
+ /**
15
+ * Numeric timestamp in miliseconds
16
+ */
17
+ DateTimeValueFormat[DateTimeValueFormat["Timestamp"] = 2] = "Timestamp";
14
18
  /**
15
19
  * Formatted date as string value, same string as displayed string
16
20
  */
17
- DateTimeValueFormat[DateTimeValueFormat["FormattedString"] = 2] = "FormattedString";
21
+ DateTimeValueFormat[DateTimeValueFormat["FormattedString"] = 3] = "FormattedString";
18
22
  /**
19
23
  * Formatted date as string value, custom string format for date time value, different from displayed string format
20
24
  */
21
- DateTimeValueFormat[DateTimeValueFormat["DataString"] = 3] = "DataString";
25
+ DateTimeValueFormat[DateTimeValueFormat["DataString"] = 4] = "DataString";
22
26
  /**
23
27
  * Range of date instances from, to
24
28
  */
25
- DateTimeValueFormat[DateTimeValueFormat["RangeOfDateInstances"] = 4] = "RangeOfDateInstances";
29
+ DateTimeValueFormat[DateTimeValueFormat["RangeOfDateInstances"] = 5] = "RangeOfDateInstances";
26
30
  })(DateTimeValueFormat || (DateTimeValueFormat = {}));
27
31
  //# sourceMappingURL=enums.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/misc/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,mBA0BX;AA1BD,WAAY,mBAAmB;IAE3B;;OAEG;IACH,6EAAY,CAAA;IAEZ;;OAEG;IACH,+EAAa,CAAA;IAEb;;OAEG;IACH,mFAAe,CAAA;IAEf;;OAEG;IACH,yEAAU,CAAA;IAEV;;OAEG;IACH,6FAAoB,CAAA;AACxB,CAAC,EA1BW,mBAAmB,KAAnB,mBAAmB,QA0B9B","sourcesContent":["/**\n * Available formats for date time value\n */\nexport enum DateTimeValueFormat\n{\n /**\n * Instance of date\n */\n DateInstance,\n\n /**\n * Numeric unix timestamp in miliseconds\n */\n UnixTimestamp,\n\n /**\n * Formatted date as string value, same string as displayed string\n */\n FormattedString,\n\n /**\n * Formatted date as string value, custom string format for date time value, different from displayed string format\n */\n DataString,\n\n /**\n * Range of date instances from, to\n */\n RangeOfDateInstances,\n}"]}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/misc/enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,mBA+BX;AA/BD,WAAY,mBAAmB;IAE3B;;OAEG;IACH,6EAAY,CAAA;IAEZ;;OAEG;IACH,+EAAa,CAAA;IAEb;;OAEG;IACH,uEAAS,CAAA;IAET;;OAEG;IACH,mFAAe,CAAA;IAEf;;OAEG;IACH,yEAAU,CAAA;IAEV;;OAEG;IACH,6FAAoB,CAAA;AACxB,CAAC,EA/BW,mBAAmB,KAAnB,mBAAmB,QA+B9B","sourcesContent":["/**\n * Available formats for date time value\n */\nexport enum DateTimeValueFormat\n{\n /**\n * Instance of date\n */\n DateInstance,\n\n /**\n * Numeric unix timestamp in seconds (only works for ControlValueAccessor, internally its Timestamp)\n */\n UnixTimestamp,\n\n /**\n * Numeric timestamp in miliseconds\n */\n Timestamp,\n\n /**\n * Formatted date as string value, same string as displayed string\n */\n FormattedString,\n\n /**\n * Formatted date as string value, custom string format for date time value, different from displayed string format\n */\n DataString,\n\n /**\n * Range of date instances from, to\n */\n RangeOfDateInstances,\n}"]}
@@ -100,7 +100,8 @@ export function formatDateTime(value, dateTimeFormat, stringFormat, dataFormat)
100
100
  return value.format(stringFormat);
101
101
  }
102
102
  if (dateTimeFormat == DateTimeValueFormat.UnixTimestamp) {
103
- return value.unixTimestamp();
103
+ //TODO: fix this in "future"
104
+ return value.unixTimestamp() * 1000;
104
105
  }
105
106
  return value.value;
106
107
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/misc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAKhF,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAG5C;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAkB,KAAqD,EACrD,OAAuB,EACvB,cAAkD,EAClD,YAAmC,EACnC,UAAiC;IAE5E,IAAG,OAAO,CAA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G,EAAE,EACL;YACI,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,UAAU,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YAEtG,IAAG,GAAG,EACN;gBACI,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC,UAAU,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;aAClG;SACJ;KACJ;SAED;QACI,MAAM,GAAG,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,YAAY,CAAC,UAAU,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC;QAEnH,IAAG,GAAG,EACN;YACI,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC,UAAU,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;SAC/F;KACJ;IAED,OAAO,aAAa,CAAC;AACzB,CAAC","sourcesContent":["import {isBlank, isJsObject, isPresent, isString, nameof} from '@jscrpt/common';\n\nimport {DateTimeValue} from '../interfaces';\nimport type {DateTimeSADirective} from '../modules/dateTime/directives/dateTime/dateTime.directive';\nimport {DateApi, DateApiObject, DateValue, DateValueProvider} from '../services';\nimport {DateTimeValueFormat} from './enums';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from './types';\n\n/**\n * Parses date time input output value\n * @param value - Value to be parsed\n * @param dateApi - Date api used for obtaining result\n * @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used\n * @param stringFormat - String format for parsing string dates, required only for string dates\n * @param dataFormat - String format for parsing string dates, required only for string dates, has higher priority than `stringFormat`\n */\nexport function parseDateTime<TDate = unknown>(value: DateTimeInputOutputValue<TDate>|undefined|null,\n dateApi: DateApi<TDate>,\n dateTimeFormat: DateTimeValueFormat|undefined|null,\n stringFormat: string|undefined|null,\n dataFormat: string|undefined|null,): DateTimeObjectValue<TDate>|undefined|null\n{\n if(isBlank(value))\n {\n return value;\n }\n\n //format is specified\n if(isPresent(dateTimeFormat))\n {\n //string format required, but format string was not provided\n if(dateTimeFormat == DateTimeValueFormat.FormattedString && isBlank(stringFormat))\n {\n throw new Error('DateTime: unable to parse string date, because format is missing!');\n }\n\n //value is range\n if(isDateTimeValue(value))\n {\n //requirested format is different\n if(dateTimeFormat != DateTimeValueFormat.RangeOfDateInstances)\n {\n throw new Error('DateTime: requested datetime format is not range, but value is range!');\n }\n\n return [\n isBlank(value.from) ? null : parseDateTime(value.from, dateApi, DateTimeValueFormat.DateInstance, null, null) as DateApiObject<TDate>,\n isBlank(value.to) ? null : parseDateTime(value.to, dateApi, DateTimeValueFormat.DateInstance, null, null) as DateApiObject<TDate>,\n ];\n }\n\n //value should be date instance, or number, or string, but it is not\n if(dateTimeFormat != DateTimeValueFormat.DateInstance &&\n dateTimeFormat != DateTimeValueFormat.FormattedString &&\n dateTimeFormat != DateTimeValueFormat.UnixTimestamp &&\n dateTimeFormat != DateTimeValueFormat.DataString)\n {\n throw new Error('DateTime: unable to get date time value, should be date instance, or string, or number!');\n }\n\n if(dateTimeFormat == DateTimeValueFormat.DataString)\n {\n //value is string, instance of date or unix timestamp\n return dateApi.getValue(value, dataFormat ?? undefined);\n }\n\n //value is string, instance of date or unix timestamp\n return dateApi.getValue(value, stringFormat ?? undefined);\n }\n\n //value is range\n if(isDateTimeValue(value))\n {\n return [\n isBlank(value.from) ? null : parseDateTime(value.from, dateApi, DateTimeValueFormat.DateInstance, null, null) as DateApiObject<TDate>,\n isBlank(value.to) ? null : parseDateTime(value.to, dateApi, DateTimeValueFormat.DateInstance , null, null) as DateApiObject<TDate>,\n ];\n }\n\n //string format, but format string was not provided\n if(isString(value) && isBlank(stringFormat) && isBlank(dataFormat))\n {\n throw new Error('DateTime: unable to parse string date, because format is missing!');\n }\n\n //value is string, instance of date or unix timestamp\n return dateApi.getValue(value, dataFormat ?? stringFormat ?? undefined);\n}\n\n/**\n * Formats value into specified format of date time\n * @param value - Value that should be converted to input output date time value\n * @param dateTimeFormat - Date time format type\n * @param stringFormat - String format for formatting string dates, required only for string dates\n * @param dataFormat - String format for formatting string dates, required only for string dates, has higher priority than `stringFormat`\n */\nexport function formatDateTime<TDate = unknown>(value: DateTimeObjectValue<TDate>|undefined|null,\n dateTimeFormat: DateTimeValueFormat,\n stringFormat: string|undefined|null,\n dataFormat: string|undefined|null,): DateTimeInputOutputValue<TDate>|undefined|null\n{\n if(isBlank(value))\n {\n return value;\n }\n\n //value is range\n if(Array.isArray(value))\n {\n //range is expected\n if(dateTimeFormat != DateTimeValueFormat.RangeOfDateInstances)\n {\n throw new Error('DateTime: value is array of values, but format is not range!');\n }\n\n return {\n from: value[0]?.value ?? null,\n to: value[1]?.value ?? null,\n };\n }\n\n //range is not expected\n if(dateTimeFormat == DateTimeValueFormat.RangeOfDateInstances)\n {\n throw new Error('DateTime: value is not array of values, but format is range!');\n }\n\n //data string date time\n if(dateTimeFormat == DateTimeValueFormat.DataString)\n {\n //string format is missing for string date time\n if(isBlank(dataFormat))\n {\n throw new Error('DateTime: missing data string format for string date time!');\n }\n\n return value.format(dataFormat);\n }\n\n //string date time\n if(dateTimeFormat == DateTimeValueFormat.FormattedString)\n {\n //string format is missing for string date time\n if(isBlank(stringFormat))\n {\n throw new Error('DateTime: missing string format for string date time!');\n }\n\n return value.format(stringFormat);\n }\n\n if(dateTimeFormat == DateTimeValueFormat.UnixTimestamp)\n {\n return value.unixTimestamp();\n }\n\n return value.value;\n}\n\n/**\n * Tests whether value is `DateTimeValue`\n * @param value - Value that is tested\n */\nexport function isDateTimeValue<TDate = unknown>(value: unknown): value is DateTimeValue<TDate>\n{\n return isJsObject(value) &&\n nameof<DateTimeValue>('from') in value &&\n nameof<DateTimeValue>('to') in value;\n}\n\n/**\n * Gets single date time value, use in places where ranged date time can not be used\n * @param value - Value to be examined\n */\nexport function getSingleDateTimeValue<TDate>(value: DateTimeInputOutputValue<TDate>|undefined|null): DateValue|TDate|null|undefined\n{\n if(isDateTimeValue(value))\n {\n throw new Error('DateTime: Unable to apply ranged date time input as value restriction!');\n }\n\n return value;\n}\n\n/**\n * Parses raw value into internal value and value\n * @param rawValue - Raw value to be parsed\n * @param dateApi - Date api for manipulation with date\n * @param dateTimeData - Object storing information about format\n * @param valueProvider - Provider used for obtaining rounded value according format\n */\nexport function parseRawInput<TDate>(rawValue: string, \n dateApi: DateApi<TDate>,\n dateTimeData: DateTimeSADirective<TDate>,\n valueProvider: DateValueProvider<TDate>,): [DateTimeObjectValue<TDate>|undefined|null, DateTimeInputOutputValue<TDate>|undefined|null]\n{\n if(!rawValue)\n {\n return [null, null];\n }\n\n const internalValue = getInternalValue(rawValue, dateApi, dateTimeData, valueProvider);\n const value = formatDateTime(internalValue, dateTimeData.valueFormat, dateTimeData.customFormat, dateTimeData.dataFormat);\n\n return [internalValue, value];\n}\n\n/**\n * Gets internal value and fix lowest time difference\n * @param value - Value to be get as internal value\n * @param dateApi - Date api for manipulation with date\n * @param dateTimeData - Object storing information about format\n * @param valueProvider - Provider used for obtaining rounded value according format\n * @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used, used when obtaining value from users input\n */\nexport function getInternalValue<TDate>(value: DateTimeInputOutputValue<TDate>|undefined|null,\n dateApi: DateApi<TDate>,\n dateTimeData: DateTimeSADirective<TDate>,\n valueProvider: DateValueProvider<TDate>,\n dateTimeFormat: DateTimeValueFormat|undefined|null = null,): DateTimeObjectValue<TDate>|undefined|null\n{\n let internalValue = parseDateTime(value, dateApi, dateTimeFormat, dateTimeData.customFormat, dateTimeData.dataFormat);\n\n if(isBlank(internalValue))\n {\n return;\n }\n\n //update for specified format, round value\n\n //ranged value\n if(Array.isArray(internalValue))\n {\n const [from, to] = internalValue;\n\n if(from)\n {\n const val = valueProvider.getValue(from.value, dateTimeData.dataFormat ?? dateTimeData.customFormat).from;\n\n if(val)\n {\n internalValue[0] = dateApi.getValue(val, dateTimeData.dataFormat ?? dateTimeData.customFormat);\n }\n }\n\n if(to)\n {\n const val = valueProvider.getValue(to.value, dateTimeData.dataFormat ?? dateTimeData.customFormat).to;\n\n if(val)\n {\n internalValue[1] = dateApi.getValue(val, dateTimeData.dataFormat ?? dateTimeData.customFormat);\n }\n }\n }\n else\n {\n const val = valueProvider.getValue(internalValue.value, dateTimeData.dataFormat ?? dateTimeData.customFormat).from;\n\n if(val)\n {\n internalValue = dateApi.getValue(val, dateTimeData.dataFormat ?? dateTimeData.customFormat);\n }\n }\n\n return internalValue;\n}"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/misc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAKhF,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAG5C;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAkB,KAAqD,EACrD,OAAuB,EACvB,cAAkD,EAClD,YAAmC,EACnC,UAAiC;IAE5E,IAAG,OAAO,CAAC,KAAK,CAAC,EACjB;QACI,OAAO,KAAK,CAAC;KAChB;IAED,qBAAqB;IACrB,IAAG,SAAS,CAAC,cAAc,CAAC,EAC5B;QACI,4DAA4D;QAC5D,IAAG,cAAc,IAAI,mBAAmB,CAAC,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC,EACjF;YACI,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;SACxF;QAED,gBAAgB;QAChB,IAAG,eAAe,CAAC,KAAK,CAAC,EACzB;YACI,iCAAiC;YACjC,IAAG,cAAc,IAAI,mBAAmB,CAAC,oBAAoB,EAC7D;gBACI,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;aAC5F;YAED,OAAO;gBACH,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,CA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AAC,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC,UAAU,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC;SAC/F;KACJ;IAED,OAAO,aAAa,CAAC;AACzB,CAAC","sourcesContent":["import {isBlank, isJsObject, isPresent, isString, nameof} from '@jscrpt/common';\n\nimport {DateTimeValue} from '../interfaces';\nimport type {DateTimeSADirective} from '../modules/dateTime/directives/dateTime/dateTime.directive';\nimport {DateApi, DateApiObject, DateValue, DateValueProvider} from '../services';\nimport {DateTimeValueFormat} from './enums';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from './types';\n\n/**\n * Parses date time input output value\n * @param value - Value to be parsed\n * @param dateApi - Date api used for obtaining result\n * @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used\n * @param stringFormat - String format for parsing string dates, required only for string dates\n * @param dataFormat - String format for parsing string dates, required only for string dates, has higher priority than `stringFormat`\n */\nexport function parseDateTime<TDate = unknown>(value: DateTimeInputOutputValue<TDate>|undefined|null,\n dateApi: DateApi<TDate>,\n dateTimeFormat: DateTimeValueFormat|undefined|null,\n stringFormat: string|undefined|null,\n dataFormat: string|undefined|null,): DateTimeObjectValue<TDate>|undefined|null\n{\n if(isBlank(value))\n {\n return value;\n }\n\n //format is specified\n if(isPresent(dateTimeFormat))\n {\n //string format required, but format string was not provided\n if(dateTimeFormat == DateTimeValueFormat.FormattedString && isBlank(stringFormat))\n {\n throw new Error('DateTime: unable to parse string date, because format is missing!');\n }\n\n //value is range\n if(isDateTimeValue(value))\n {\n //requirested format is different\n if(dateTimeFormat != DateTimeValueFormat.RangeOfDateInstances)\n {\n throw new Error('DateTime: requested datetime format is not range, but value is range!');\n }\n\n return [\n isBlank(value.from) ? null : parseDateTime(value.from, dateApi, DateTimeValueFormat.DateInstance, null, null) as DateApiObject<TDate>,\n isBlank(value.to) ? null : parseDateTime(value.to, dateApi, DateTimeValueFormat.DateInstance, null, null) as DateApiObject<TDate>,\n ];\n }\n\n //value should be date instance, or number, or string, but it is not\n if(dateTimeFormat != DateTimeValueFormat.DateInstance &&\n dateTimeFormat != DateTimeValueFormat.FormattedString &&\n dateTimeFormat != DateTimeValueFormat.UnixTimestamp &&\n dateTimeFormat != DateTimeValueFormat.DataString)\n {\n throw new Error('DateTime: unable to get date time value, should be date instance, or string, or number!');\n }\n\n if(dateTimeFormat == DateTimeValueFormat.DataString)\n {\n //value is string, instance of date or unix timestamp\n return dateApi.getValue(value, dataFormat ?? undefined);\n }\n\n //value is string, instance of date or unix timestamp\n return dateApi.getValue(value, stringFormat ?? undefined);\n }\n\n //value is range\n if(isDateTimeValue(value))\n {\n return [\n isBlank(value.from) ? null : parseDateTime(value.from, dateApi, DateTimeValueFormat.DateInstance, null, null) as DateApiObject<TDate>,\n isBlank(value.to) ? null : parseDateTime(value.to, dateApi, DateTimeValueFormat.DateInstance , null, null) as DateApiObject<TDate>,\n ];\n }\n\n //string format, but format string was not provided\n if(isString(value) && isBlank(stringFormat) && isBlank(dataFormat))\n {\n throw new Error('DateTime: unable to parse string date, because format is missing!');\n }\n\n //value is string, instance of date or unix timestamp\n return dateApi.getValue(value, dataFormat ?? stringFormat ?? undefined);\n}\n\n/**\n * Formats value into specified format of date time\n * @param value - Value that should be converted to input output date time value\n * @param dateTimeFormat - Date time format type\n * @param stringFormat - String format for formatting string dates, required only for string dates\n * @param dataFormat - String format for formatting string dates, required only for string dates, has higher priority than `stringFormat`\n */\nexport function formatDateTime<TDate = unknown>(value: DateTimeObjectValue<TDate>|undefined|null,\n dateTimeFormat: DateTimeValueFormat,\n stringFormat: string|undefined|null,\n dataFormat: string|undefined|null,): DateTimeInputOutputValue<TDate>|undefined|null\n{\n if(isBlank(value))\n {\n return value;\n }\n\n //value is range\n if(Array.isArray(value))\n {\n //range is expected\n if(dateTimeFormat != DateTimeValueFormat.RangeOfDateInstances)\n {\n throw new Error('DateTime: value is array of values, but format is not range!');\n }\n\n return {\n from: value[0]?.value ?? null,\n to: value[1]?.value ?? null,\n };\n }\n\n //range is not expected\n if(dateTimeFormat == DateTimeValueFormat.RangeOfDateInstances)\n {\n throw new Error('DateTime: value is not array of values, but format is range!');\n }\n\n //data string date time\n if(dateTimeFormat == DateTimeValueFormat.DataString)\n {\n //string format is missing for string date time\n if(isBlank(dataFormat))\n {\n throw new Error('DateTime: missing data string format for string date time!');\n }\n\n return value.format(dataFormat);\n }\n\n //string date time\n if(dateTimeFormat == DateTimeValueFormat.FormattedString)\n {\n //string format is missing for string date time\n if(isBlank(stringFormat))\n {\n throw new Error('DateTime: missing string format for string date time!');\n }\n\n return value.format(stringFormat);\n }\n\n if(dateTimeFormat == DateTimeValueFormat.UnixTimestamp)\n {\n //TODO: fix this in \"future\"\n return value.unixTimestamp() * 1000;\n }\n\n return value.value;\n}\n\n/**\n * Tests whether value is `DateTimeValue`\n * @param value - Value that is tested\n */\nexport function isDateTimeValue<TDate = unknown>(value: unknown): value is DateTimeValue<TDate>\n{\n return isJsObject(value) &&\n nameof<DateTimeValue>('from') in value &&\n nameof<DateTimeValue>('to') in value;\n}\n\n/**\n * Gets single date time value, use in places where ranged date time can not be used\n * @param value - Value to be examined\n */\nexport function getSingleDateTimeValue<TDate>(value: DateTimeInputOutputValue<TDate>|undefined|null): DateValue|TDate|null|undefined\n{\n if(isDateTimeValue(value))\n {\n throw new Error('DateTime: Unable to apply ranged date time input as value restriction!');\n }\n\n return value;\n}\n\n/**\n * Parses raw value into internal value and value\n * @param rawValue - Raw value to be parsed\n * @param dateApi - Date api for manipulation with date\n * @param dateTimeData - Object storing information about format\n * @param valueProvider - Provider used for obtaining rounded value according format\n */\nexport function parseRawInput<TDate>(rawValue: string, \n dateApi: DateApi<TDate>,\n dateTimeData: DateTimeSADirective<TDate>,\n valueProvider: DateValueProvider<TDate>,): [DateTimeObjectValue<TDate>|undefined|null, DateTimeInputOutputValue<TDate>|undefined|null]\n{\n if(!rawValue)\n {\n return [null, null];\n }\n\n const internalValue = getInternalValue(rawValue, dateApi, dateTimeData, valueProvider);\n const value = formatDateTime(internalValue, dateTimeData.valueFormat, dateTimeData.customFormat, dateTimeData.dataFormat);\n\n return [internalValue, value];\n}\n\n/**\n * Gets internal value and fix lowest time difference\n * @param value - Value to be get as internal value\n * @param dateApi - Date api for manipulation with date\n * @param dateTimeData - Object storing information about format\n * @param valueProvider - Provider used for obtaining rounded value according format\n * @param dateTimeFormat - Date time format type, optional, if not specified autodetection of format will be used, used when obtaining value from users input\n */\nexport function getInternalValue<TDate>(value: DateTimeInputOutputValue<TDate>|undefined|null,\n dateApi: DateApi<TDate>,\n dateTimeData: DateTimeSADirective<TDate>,\n valueProvider: DateValueProvider<TDate>,\n dateTimeFormat: DateTimeValueFormat|undefined|null = null,): DateTimeObjectValue<TDate>|undefined|null\n{\n let internalValue = parseDateTime(value, dateApi, dateTimeFormat, dateTimeData.customFormat, dateTimeData.dataFormat);\n\n if(isBlank(internalValue))\n {\n return;\n }\n\n //update for specified format, round value\n\n //ranged value\n if(Array.isArray(internalValue))\n {\n const [from, to] = internalValue;\n\n if(from)\n {\n const val = valueProvider.getValue(from.value, dateTimeData.dataFormat ?? dateTimeData.customFormat).from;\n\n if(val)\n {\n internalValue[0] = dateApi.getValue(val, dateTimeData.dataFormat ?? dateTimeData.customFormat);\n }\n }\n\n if(to)\n {\n const val = valueProvider.getValue(to.value, dateTimeData.dataFormat ?? dateTimeData.customFormat).to;\n\n if(val)\n {\n internalValue[1] = dateApi.getValue(val, dateTimeData.dataFormat ?? dateTimeData.customFormat);\n }\n }\n }\n else\n {\n const val = valueProvider.getValue(internalValue.value, dateTimeData.dataFormat ?? dateTimeData.customFormat).from;\n\n if(val)\n {\n internalValue = dateApi.getValue(val, dateTimeData.dataFormat ?? dateTimeData.customFormat);\n }\n }\n\n return internalValue;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dateApi.interface.js","sourceRoot":"","sources":["../../../../src/services/dateApi/dateApi.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Date can be represented as formatted string, timestamp or javascript Date object\n */\nexport type DateValue = Date|string|number;\n\n/**\n * Type that represents date object, either as date api or plain\n */\nexport type DateObject<TDate> = TDate|DateApiObject<TDate>;\n\n/**\n * Definition of type, that is used for creating instance of DateApiObject\n */\nexport interface DateApiObjectCtor<TDate = unknown, TObject extends DateApiObject<TDate> = DateApiObject<TDate>>\n{\n new (value: TDate|DateValue, format?: string, ...additionalParams: any[]): TObject;\n}\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport interface DateApiObject<TDate = unknown>\n{\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n readonly originalValue: TDate;\n\n /**\n * Instance of date\n */\n readonly value: TDate;\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n isValid(): boolean;\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n isWeekend(): boolean;\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n format(format: string): string;\n\n /**\n * Formats date value as ISO string representation\n */\n formatISO(): string;\n\n /**\n * Gets value of date time as unix timestamp\n */\n unixTimestamp(): number;\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n startOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n endOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n startOfYear(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n endOfYear(): DateApiObject<TDate>;\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n addYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n subtractYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n startOfMonth(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n endOfMonth(): DateApiObject<TDate>;\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n addMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n subtractMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n startOfWeek(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n endOfWeek(): DateApiObject<TDate>;\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n addWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n subtractWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n startOfDay(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n endOfDay(): DateApiObject<TDate>;\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n addDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n subtractDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n startOfHour(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n endOfHour(): DateApiObject<TDate>;\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n addHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n subtractHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n startOfMinute(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n endOfMinute(): DateApiObject<TDate>;\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n addMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n subtractMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Gets number of days in month\n */\n daysInMonth(): number;\n\n /**\n * Gets year\n */\n year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n year(year: number): DateApiObject<TDate>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n year(year?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets month\n */\n month(): number;\n /**\n * Sets month\n * @param month - Month to be set\n */\n month(month: number): DateApiObject<TDate>;\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n month(month?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of month one based\n */\n dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n dayOfMonth(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n dayOfMonth(day?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of week zero based, first is monday\n */\n dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n dayOfWeek(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n dayOfWeek(day?: number): number|DateApiObject<TDate>;\n\n /**\n * Gets hours zero based\n */\n hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n hour(hour: number): DateApiObject<TDate>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n hour(hour?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets minutes zero based\n */\n minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n minute(minute: number): DateApiObject<TDate>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n minute(minute?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n isBefore(date: DateObject<TDate>): boolean;\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n isAfter(date: DateObject<TDate>): boolean;\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n diffDays(date: DateObject<TDate>): number;\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n isSameWeek(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n isSameDecade(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n isSameYear(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n isSameMonth(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n isSameDay(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether is date same as provided date\n * @param date - Date which is used for comparison whether is same date time\n */\n isSame(date: DateObject<TDate>): boolean;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n clone(): DateApiObject<TDate>;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n cloneOriginal(): DateApiObject<TDate>;\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n updateOriginal(value?: DateObject<TDate>): DateApiObject<TDate>;\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n resetOriginal(): DateApiObject<TDate>;\n}\n\n/**\n * Date api abstraction, used for obtaining DateApi wrapper object\n */\nexport interface DateApi<TDate = unknown, TDateApiObject extends DateApiObject<TDate> = DateApiObject<TDate>>\n{\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n getValue(value: DateValue|TDate, format?: string): TDateApiObject;\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n now(): TDateApiObject;\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n getFormat(pseudoFormat: string): string;\n\n /**\n * Gets information\n */\n weekStartsOnMonday(): boolean;\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n weekdaysShort(): string[];\n\n /**\n * Tests whether is value TDate\n * @param value - Value to be tested whether is TDate\n */\n isDate(value: unknown): value is TDate;\n}"]}
1
+ {"version":3,"file":"dateApi.interface.js","sourceRoot":"","sources":["../../../../src/services/dateApi/dateApi.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Date can be represented as formatted string, timestamp or javascript Date object\n */\nexport type DateValue = Date|string|number;\n\n/**\n * Type that represents date object, either as date api or plain\n */\nexport type DateObject<TDate> = TDate|DateApiObject<TDate>;\n\n/**\n * Definition of type, that is used for creating instance of DateApiObject\n */\nexport interface DateApiObjectCtor<TDate = unknown, TObject extends DateApiObject<TDate> = DateApiObject<TDate>>\n{\n new (value: TDate|DateValue, format?: string, ...additionalParams: any[]): TObject;\n}\n\n/**\n * Instance of object wrapping TDate, allowing manipulation with it\n */\nexport interface DateApiObject<TDate = unknown>\n{\n /**\n * Original value that is not changed unless 'updateOriginal' is called\n */\n readonly originalValue: TDate;\n\n /**\n * Instance of date\n */\n readonly value: TDate;\n\n /**\n * Gets indication whether provided instance of date is valid\n */\n isValid(): boolean;\n\n /**\n * Gets indication whether provided instance of date is weekend day\n */\n isWeekend(): boolean;\n\n /**\n * Formats date value\n * @param format - Format token used for creating formatted string\n */\n format(format: string): string;\n\n /**\n * Formats date value as ISO string representation\n */\n formatISO(): string;\n\n /**\n * Gets value of date time as unix timestamp (in seconds)\n */\n unixTimestamp(): number;\n\n /**\n * Gets value of date time as timestamp (in miliseconds)\n */\n timestamp(): number;\n\n /**\n * Updates value to start date and time of current decade\n * @returns Itself for fluent API\n */\n startOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current decade\n * @returns Itself for fluent API\n */\n endOfDecade(): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current year\n * @returns Itself for fluent API\n */\n startOfYear(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current year\n * @returns Itself for fluent API\n */\n endOfYear(): DateApiObject<TDate>;\n\n /**\n * Add years, if count not specified adds 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n addYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract years, if count not specified subtract 1 year\n * @param count - Number of years count\n * @returns Itself for fluent API\n */\n subtractYears(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current month\n * @returns Itself for fluent API\n */\n startOfMonth(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current month\n * @returns Itself for fluent API\n */\n endOfMonth(): DateApiObject<TDate>;\n\n /**\n * Add months, if count not specified adds 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n addMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract months, if count not specified subtract 1 month\n * @param count - Number of months count\n * @returns Itself for fluent API\n */\n subtractMonths(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current week\n * @returns Itself for fluent API\n */\n startOfWeek(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current week\n * @returns Itself for fluent API\n */\n endOfWeek(): DateApiObject<TDate>;\n\n /**\n * Add weeks, if count not specified adds 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n addWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract weeks, if count not specified subtract 1 week\n * @param count - Number of weeks count\n * @returns Itself for fluent API\n */\n subtractWeeks(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current day\n * @returns Itself for fluent API\n */\n startOfDay(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current day\n * @returns Itself for fluent API\n */\n endOfDay(): DateApiObject<TDate>;\n\n /**\n * Add days, if count not specified adds 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n addDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract days, if count not specified subtract 1 day\n * @param count - Number of days count\n * @returns Itself for fluent API\n */\n subtractDays(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current hour\n * @returns Itself for fluent API\n */\n startOfHour(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current hour\n * @returns Itself for fluent API\n */\n endOfHour(): DateApiObject<TDate>;\n\n /**\n * Add hours, if count not specified adds 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n addHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract hours, if count not specified subtract 1 hour\n * @param count - Number of hours count\n * @returns Itself for fluent API\n */\n subtractHours(count?: number): DateApiObject<TDate>;\n\n /**\n * Updates value to start date and time of current minute\n * @returns Itself for fluent API\n */\n startOfMinute(): DateApiObject<TDate>;\n\n /**\n * Updates value to end date and time of current minute\n * @returns Itself for fluent API\n */\n endOfMinute(): DateApiObject<TDate>;\n\n /**\n * Add minutes, if count not specified adds 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n addMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Subtract minutes, if count not specified subtract 1 minute\n * @param count - Number of minutes count\n * @returns Itself for fluent API\n */\n subtractMinutes(count?: number): DateApiObject<TDate>;\n\n /**\n * Gets number of days in month\n */\n daysInMonth(): number;\n\n /**\n * Gets year\n */\n year(): number;\n /**\n * Sets year\n * @param year - Year to be set\n */\n year(year: number): DateApiObject<TDate>;\n /**\n * Gets or sets year\n * @param year - If specified, sets year\n */\n year(year?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets month\n */\n month(): number;\n /**\n * Sets month\n * @param month - Month to be set\n */\n month(month: number): DateApiObject<TDate>;\n /**\n * Gets or sets month\n * @param month - If specified, sets month\n */\n month(month?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of month one based\n */\n dayOfMonth(): number;\n /**\n * Sets day of month one based\n * @param day - Day of month to be set\n */\n dayOfMonth(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of month one based\n * @param day - If specified, sets day of month\n */\n dayOfMonth(day?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets day of week zero based, first is monday\n */\n dayOfWeek(): number;\n /**\n * Sets day of week zero based, first is monday\n * @param day - Day of week to be set\n */\n dayOfWeek(day: number): DateApiObject<TDate>;\n /**\n * Gets or sets day of week zero based, first is monday\n * @param day - If specified, sets day of week\n */\n dayOfWeek(day?: number): number|DateApiObject<TDate>;\n\n /**\n * Gets hours zero based\n */\n hour(): number;\n /**\n * Sets hours zero\n * @param hour - hour to be set\n */\n hour(hour: number): DateApiObject<TDate>;\n /**\n * Gets or sets hours zero\n * @param hour - If specified, sets hour\n */\n hour(hour?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets minutes zero based\n */\n minute(): number;\n /**\n * Sets minutes zero based\n * @param minute - minutes to be set\n */\n minute(minute: number): DateApiObject<TDate>;\n /**\n * Gets or sets minutes zero based\n * @param minute - If specified, sets minutes\n */\n minute(minute?: number): DateApiObject<TDate>|number;\n\n /**\n * Gets indication whether current value is before 'date'\n * @param date - Date which is this date compared to\n */\n isBefore(date: DateObject<TDate>): boolean;\n\n /**\n * Gets indication whether current value is after 'date'\n * @param date - Date which is this date compared to\n */\n isAfter(date: DateObject<TDate>): boolean;\n\n /**\n * Gets number of days between this and provided date\n * @param date - Date which is used for computation of diff against\n */\n diffDays(date: DateObject<TDate>): number;\n\n /**\n * Compares whether this date is same week as provided date\n * @param date - Date which is used for comparison of same week\n */\n isSameWeek(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same decade as provided date\n * @param date - Date which is used for comparison of same decade\n */\n isSameDecade(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same year as provided date\n * @param date - Date which is used for comparison of same year\n */\n isSameYear(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same month as provided date\n * @param date - Date which is used for comparison of same month\n */\n isSameMonth(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether this date is same day as provided date\n * @param date - Date which is used for comparison of same day\n */\n isSameDay(date: DateObject<TDate>): boolean;\n\n /**\n * Compares whether is date same as provided date\n * @param date - Date which is used for comparison whether is same date time\n */\n isSame(date: DateObject<TDate>): boolean;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from value\n */\n clone(): DateApiObject<TDate>;\n\n /**\n * Creates clone of this instance, value and originalValue have same value and are cloned from originalValue\n */\n cloneOriginal(): DateApiObject<TDate>;\n\n /**\n * Updates originalValue, if value is not provided originalValue is set to value\n * @param value - Value to be set as original, or null (value will be used as value)\n * @returns Itself for fluent API\n */\n updateOriginal(value?: DateObject<TDate>): DateApiObject<TDate>;\n\n /**\n * Changes value to same value as originalValue\n * @returns Itself for fluent API\n */\n resetOriginal(): DateApiObject<TDate>;\n}\n\n/**\n * Date api abstraction, used for obtaining DateApi wrapper object\n */\nexport interface DateApi<TDate = unknown, TDateApiObject extends DateApiObject<TDate> = DateApiObject<TDate>>\n{\n /**\n * Gets wrapping object used for manipulation\n * @param value - Value to be converted (parsed) and used for manipulation\n * @param format - Format string used for parsing string value\n */\n getValue(value: DateValue|TDate, format?: string): TDateApiObject;\n\n /**\n * Gets wrapping object used for manipulation instantiated to current date and time\n */\n now(): TDateApiObject;\n\n /**\n * Gets format string using pseudo format\n * @param pseudoFormat - Pseudo format token, used for obtaining 'date' or 'time' format string\n */\n getFormat(pseudoFormat: string): string;\n\n /**\n * Gets information\n */\n weekStartsOnMonday(): boolean;\n\n /**\n * Gets array of weekday names in short format, order of days is dependent on locale\n */\n weekdaysShort(): string[];\n\n /**\n * Tests whether is value TDate\n * @param value - Value to be tested whether is TDate\n */\n isDate(value: unknown): value is TDate;\n}"]}
@@ -44,6 +44,10 @@ export declare class MomentDateApiObject implements DateApiObject<moment.Moment>
44
44
  * @inheritdoc
45
45
  */
46
46
  unixTimestamp(): number;
47
+ /**
48
+ * @inheritdoc
49
+ */
50
+ timestamp(): number;
47
51
  /**
48
52
  * Updates value to start date and time of current decade
49
53
  * @returns Itself for fluent API
@@ -1 +1 @@
1
- {"version":3,"file":"momentDateApi.service.d.ts","sourceRoot":"","sources":["momentDateApi.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAC,MAAM,eAAe,CAAC;AAChE,OAAO,EAAC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAwB,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAE/I,OAAO,MAA2B,MAAM,QAAQ,CAAC;;AAEjD;;GAEG;AACH,qBAAa,mBAAoB,YAAW,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IAIpE;;OAEG;IACH,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC;IAExC;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IAIhC;;OAEG;IACH,IAAW,aAAa,IAAI,MAAM,CAAC,MAAM,CAGxC;IAED;;OAEG;IACH,IAAW,KAAK,IAAI,MAAM,CAAC,MAAM,CAGhC;gBAGW,KAAK,EAAE,SAAS,GAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;IAO3D;;OAEG;IACI,OAAO,IAAI,OAAO;IAKzB;;OAEG;IACI,SAAS,IAAI,OAAO;IAO3B;;;OAGG;IACI,MAAM,CA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I,GAAG,IAAI,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IAK1C;;;OAGG;IACI,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;IAU9C;;OAEG;IACI,kBAAkB,IAAI,OAAO;IAKpC;;OAEG;IACI,aAAa,IAAI,MAAM,EAAE;IAKhC;;OAEG;IACI,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM;yCA7D5C,aAAa;6CAAb,aAAa;CAiEzB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAuB,CAAC;AAElH;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,aAIzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/datetime",
3
- "version": "8.1.0-beta.20240704065846",
3
+ "version": "8.1.0-beta.20240704075145",
4
4
  "description": "Angular library for datetime manipulation components",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -7,20 +7,24 @@ export declare enum DateTimeValueFormat {
7
7
  */
8
8
  DateInstance = 0,
9
9
  /**
10
- * Numeric unix timestamp in miliseconds
10
+ * Numeric unix timestamp in seconds (only works for ControlValueAccessor, internally its Timestamp)
11
11
  */
12
12
  UnixTimestamp = 1,
13
+ /**
14
+ * Numeric timestamp in miliseconds
15
+ */
16
+ Timestamp = 2,
13
17
  /**
14
18
  * Formatted date as string value, same string as displayed string
15
19
  */
16
- FormattedString = 2,
20
+ FormattedString = 3,
17
21
  /**
18
22
  * Formatted date as string value, custom string format for date time value, different from displayed string format
19
23
  */
20
- DataString = 3,
24
+ DataString = 4,
21
25
  /**
22
26
  * Range of date instances from, to
23
27
  */
24
- RangeOfDateInstances = 4
28
+ RangeOfDateInstances = 5
25
29
  }
26
30
  //# sourceMappingURL=enums.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,mBAAmB;IAE3B;;OAEG;IACH,YAAY,IAAA;IAEZ;;OAEG;IACH,aAAa,IAAA;IAEb;;OAEG;IACH,eAAe,IAAA;IAEf;;OAEG;IACH,UAAU,IAAA;IAEV;;OAEG;IACH,oBAAoB,IAAA;CACvB"}
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["enums.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,mBAAmB;IAE3B;;OAEG;IACH,YAAY,IAAA;IAEZ;;OAEG;IACH,aAAa,IAAA;IAEb;;OAEG;IACH,SAAS,IAAA;IAET;;OAEG;IACH,eAAe,IAAA;IAEf;;OAEG;IACH,UAAU,IAAA;IAEV;;OAEG;IACH,oBAAoB,IAAA;CACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAC,OAAO,EAAiB,SAAS,EAAE,iBAAiB,EAAC,MAAM,aAAa,CAAC;AACjF,OAAO,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAC,wBAAwB,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAEtE;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,EACrD,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EACvB,cAAc,EAAE,mBAAmB,GAAC,SAAS,GAAC,IAAI,EAClD,YAAY,EAAE,MAAM,GAAC,SAAS,GAAC,IAAI,EACnC,UAAU,EAAE,MAAM,GAAC,SAAS,GAAC,IAAI,GAAI,mBAAmB,C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B,eAAe,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAAC,KAAK,CAAC,CAK9F;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,GAAG,SAAS,GAAC,KAAK,GAAC,IAAI,GAAC,SAAS,CAQnI;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EACvB,YAAY,EAAE,mBAAmB,CAAC,KAAK,CAAC,EACxC,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC,GAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAAC,CAW1K;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,EACrD,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EACvB,YAAY,EAAE,mBAAmB,CAAC,KAAK,CAAC,EACxC,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC,EACvC,cAAc,GAAE,mBAAmB,GAAC,SAAS,GAAC,IAAW,GAAI,mBAAmB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CA+C7I"}
@@ -42,9 +42,13 @@ export interface DateApiObject<TDate = unknown> {
42
42
  */
43
43
  formatISO(): string;
44
44
  /**
45
- * Gets value of date time as unix timestamp
45
+ * Gets value of date time as unix timestamp (in seconds)
46
46
  */
47
47
  unixTimestamp(): number;
48
+ /**
49
+ * Gets value of date time as timestamp (in miliseconds)
50
+ */
51
+ timestamp(): number;
48
52
  /**
49
53
  * Updates value to start date and time of current decade
50
54
  * @returns Itself for fluent API
@@ -1 +1 @@
1
- {"version":3,"file":"dateApi.interface.d.ts","sourceRoot":"","sources":["dateApi.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAC,MAAM,GAAC,MAAM,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,KAAK,IAAI,KAAK,GAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,KAAK,GAAG,OAAO,EAAE,OAAO,SAAS,aAAa,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC;IAE3G,KAAK,KAAK,EAAE,KAAK,GAAC,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;CACtF;AAED;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,OAAO;IAE1C;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,KAAK,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC;IAEnB;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC;IAErB;;;OAGG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,IAAI,MAAM,CAAC;IAExB;;;OAGG;IACH,aAAa,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAEtC;;;OAGG;IACH,WAAW,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAEpC;;;OAGG;IACH,WAAW,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAEpC;;;OAGG;IACH,SAAS,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;IAEl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