@acorex/core 16.0.2 → 17.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/common/README.md +3 -0
- package/common/countries/countries.data.d.ts +2 -0
- package/common/countries/country.d.ts +13 -0
- package/common/index.d.ts +2 -0
- package/config/README.md +3 -0
- package/config/index.d.ts +2 -0
- package/config/lib/configs.d.ts +6 -0
- package/config/lib/configs.service.d.ts +12 -0
- package/date-time/README.md +3 -0
- package/date-time/index.d.ts +10 -0
- package/date-time/lib/calendar.service.d.ts +27 -0
- package/date-time/lib/dateTime.config.d.ts +12 -0
- package/date-time/lib/datetime.class.d.ts +138 -0
- package/date-time/lib/datetime.module.d.ts +8 -0
- package/date-time/lib/datetime.pipe.d.ts +12 -0
- package/date-time/lib/formatters/datetime-formatter.d.ts +19 -0
- package/date-time/lib/formatters/timeleft-formatter.d.ts +16 -0
- package/date-time/lib/georgian.calendar.d.ts +21 -0
- package/date-time/lib/holidays.loader.d.ts +21 -0
- package/date-time/lib/jalali.calendar.d.ts +40 -0
- package/esm2022/common/acorex-core-common.mjs +5 -0
- package/esm2022/common/countries/countries.data.mjs +2625 -0
- package/esm2022/common/countries/country.mjs +2 -0
- package/esm2022/common/index.mjs +3 -0
- package/esm2022/config/acorex-core-config.mjs +5 -0
- package/esm2022/config/index.mjs +3 -0
- package/esm2022/config/lib/configs.mjs +7 -0
- package/esm2022/config/lib/configs.service.mjs +27 -0
- package/esm2022/date-time/acorex-core-date-time.mjs +5 -0
- package/esm2022/date-time/index.mjs +11 -0
- package/esm2022/date-time/lib/calendar.service.mjs +100 -0
- package/esm2022/date-time/lib/dateTime.config.mjs +50 -0
- package/esm2022/date-time/lib/datetime.class.mjs +337 -0
- package/esm2022/date-time/lib/datetime.module.mjs +27 -0
- package/esm2022/date-time/lib/datetime.pipe.mjs +29 -0
- package/esm2022/date-time/lib/formatters/datetime-formatter.mjs +32 -0
- package/esm2022/date-time/lib/formatters/timeleft-formatter.mjs +91 -0
- package/esm2022/date-time/lib/georgian.calendar.mjs +203 -0
- package/esm2022/date-time/lib/holidays.loader.mjs +13 -0
- package/esm2022/date-time/lib/jalali.calendar.mjs +440 -0
- package/esm2022/events/acorex-core-events.mjs +5 -0
- package/esm2022/events/index.mjs +3 -0
- package/esm2022/events/lib/event.service.mjs +43 -0
- package/esm2022/events/lib/event.type.mjs +6 -0
- package/esm2022/file/acorex-core-file.mjs +5 -0
- package/esm2022/file/index.mjs +7 -0
- package/esm2022/file/lib/file-download-ref.class.mjs +12 -0
- package/esm2022/file/lib/file-download-result.class.mjs +45 -0
- package/esm2022/file/lib/file-size-formatter.mjs +24 -0
- package/esm2022/file/lib/file-upload-ref.class.mjs +12 -0
- package/esm2022/file/lib/file.module.mjs +20 -0
- package/esm2022/file/lib/file.service.mjs +103 -0
- package/esm2022/format/acorex-core-format.mjs +5 -0
- package/esm2022/format/index.mjs +8 -0
- package/esm2022/format/lib/format.config.mjs +3 -0
- package/esm2022/format/lib/format.module.mjs +64 -0
- package/esm2022/format/lib/format.pipe.mjs +37 -0
- package/esm2022/format/lib/format.service.mjs +95 -0
- package/esm2022/format/lib/format.types.mjs +2 -0
- package/esm2022/format/lib/formatters/number-formatter.mjs +74 -0
- package/esm2022/format/lib/formatters/string-formatter.mjs +15 -0
- package/esm2022/image/acorex-core-image.mjs +5 -0
- package/esm2022/image/index.mjs +2 -0
- package/esm2022/image/lib/image.service.mjs +43 -0
- package/esm2022/index.mjs +2 -44
- package/esm2022/memorize/acorex-core-memorize.mjs +5 -0
- package/esm2022/memorize/index.mjs +2 -0
- package/esm2022/memorize/lib/memorize.decorator.mjs +19 -0
- package/esm2022/pipes/acorex-core-pipes.mjs +5 -0
- package/esm2022/pipes/index.mjs +2 -0
- package/esm2022/pipes/lib/safe/safe.pipe.mjs +38 -0
- package/esm2022/platform/acorex-core-platform.mjs +5 -0
- package/esm2022/platform/index.mjs +2 -0
- package/esm2022/platform/lib/platform.service.mjs +225 -0
- package/esm2022/storage/acorex-core-storage.mjs +5 -0
- package/esm2022/storage/cookie-storage.service.mjs +202 -0
- package/esm2022/storage/index.mjs +5 -0
- package/esm2022/storage/local-storage.service.mjs +58 -0
- package/esm2022/storage/session-storage.service.mjs +22 -0
- package/esm2022/storage/storage.interface.mjs +2 -0
- package/esm2022/translation/acorex-core-translation.mjs +5 -0
- package/esm2022/translation/index.mjs +9 -0
- package/esm2022/translation/lib/translation-scope.resolver.mjs +11 -0
- package/esm2022/translation/lib/translation.config.mjs +20 -0
- package/esm2022/translation/lib/translation.loader.mjs +14 -0
- package/esm2022/translation/lib/translation.module.mjs +40 -0
- package/esm2022/translation/lib/translation.service.mjs +173 -0
- package/esm2022/translation/lib/translation.types.mjs +2 -0
- package/esm2022/translation/lib/translator.directive.mjs +28 -0
- package/esm2022/translation/lib/translator.pipe.mjs +23 -0
- package/esm2022/types/acorex-core-types.mjs +5 -0
- package/esm2022/types/index.mjs +2 -0
- package/esm2022/utils/acorex-core-utils.mjs +5 -0
- package/esm2022/utils/index.mjs +6 -0
- package/esm2022/utils/lib/auto-unsubscribe.mjs +36 -0
- package/esm2022/utils/lib/color-util.mjs +111 -0
- package/esm2022/utils/lib/drawing-util.mjs +35 -0
- package/esm2022/utils/lib/html-util.mjs +39 -0
- package/esm2022/utils/lib/string-util.mjs +19 -0
- package/esm2022/validation/acorex-core-validation.mjs +5 -0
- package/esm2022/validation/index.mjs +18 -0
- package/esm2022/validation/lib/rules/between-rule.mjs +31 -0
- package/esm2022/validation/lib/rules/callback-rule.mjs +29 -0
- package/esm2022/validation/lib/rules/equal-rule.mjs +26 -0
- package/esm2022/validation/lib/rules/greater-than.mjs +29 -0
- package/esm2022/validation/lib/rules/length-rule.mjs +26 -0
- package/esm2022/validation/lib/rules/less-than-rule.mjs +29 -0
- package/esm2022/validation/lib/rules/maxlength-rule.mjs +27 -0
- package/esm2022/validation/lib/rules/minlength-rule.mjs +26 -0
- package/esm2022/validation/lib/rules/regex-rule.mjs +49 -0
- package/esm2022/validation/lib/rules/required-rule.mjs +36 -0
- package/esm2022/validation/lib/validation.config.mjs +33 -0
- package/esm2022/validation/lib/validation.module.mjs +84 -0
- package/esm2022/validation/lib/validation.service.mjs +98 -0
- package/esm2022/validation/lib/validation.types.mjs +3 -0
- package/events/README.md +3 -0
- package/events/index.d.ts +2 -0
- package/{lib/services → events/lib}/event.service.d.ts +8 -0
- package/events/lib/event.type.d.ts +5 -0
- package/fesm2022/acorex-core-common.mjs +2631 -0
- package/fesm2022/acorex-core-common.mjs.map +1 -0
- package/fesm2022/acorex-core-config.mjs +39 -0
- package/fesm2022/acorex-core-config.mjs.map +1 -0
- package/fesm2022/acorex-core-date-time.mjs +1305 -0
- package/fesm2022/acorex-core-date-time.mjs.map +1 -0
- package/fesm2022/acorex-core-events.mjs +56 -0
- package/fesm2022/acorex-core-events.mjs.map +1 -0
- package/fesm2022/acorex-core-file.mjs +214 -0
- package/fesm2022/acorex-core-file.mjs.map +1 -0
- package/fesm2022/acorex-core-format.mjs +282 -0
- package/fesm2022/acorex-core-format.mjs.map +1 -0
- package/fesm2022/acorex-core-image.mjs +50 -0
- package/fesm2022/acorex-core-image.mjs.map +1 -0
- package/fesm2022/acorex-core-memorize.mjs +26 -0
- package/fesm2022/acorex-core-memorize.mjs.map +1 -0
- package/fesm2022/acorex-core-pipes.mjs +44 -0
- package/fesm2022/acorex-core-pipes.mjs.map +1 -0
- package/fesm2022/acorex-core-platform.mjs +232 -0
- package/fesm2022/acorex-core-platform.mjs.map +1 -0
- package/fesm2022/acorex-core-storage.mjs +285 -0
- package/fesm2022/acorex-core-storage.mjs.map +1 -0
- package/fesm2022/acorex-core-translation.mjs +293 -0
- package/fesm2022/acorex-core-translation.mjs.map +1 -0
- package/fesm2022/acorex-core-types.mjs +6 -0
- package/fesm2022/acorex-core-types.mjs.map +1 -0
- package/fesm2022/acorex-core-utils.mjs +247 -0
- package/fesm2022/acorex-core-utils.mjs.map +1 -0
- package/fesm2022/acorex-core-validation.mjs +488 -0
- package/fesm2022/acorex-core-validation.mjs.map +1 -0
- package/fesm2022/acorex-core.mjs +2 -2309
- package/fesm2022/acorex-core.mjs.map +1 -1
- package/file/README.md +3 -0
- package/file/index.d.ts +6 -0
- package/file/lib/file-download-ref.class.d.ts +6 -0
- package/file/lib/file-download-result.class.d.ts +8 -0
- package/file/lib/file-size-formatter.d.ts +16 -0
- package/file/lib/file-upload-ref.class.d.ts +5 -0
- package/file/lib/file.module.d.ts +7 -0
- package/file/lib/file.service.d.ts +18 -0
- package/format/README.md +3 -0
- package/format/index.d.ts +7 -0
- package/format/lib/format.config.d.ts +5 -0
- package/format/lib/format.module.d.ts +18 -0
- package/format/lib/format.pipe.d.ts +12 -0
- package/format/lib/format.service.d.ts +43 -0
- package/format/lib/format.types.d.ts +4 -0
- package/format/lib/formatters/number-formatter.d.ts +23 -0
- package/format/lib/formatters/string-formatter.d.ts +14 -0
- package/image/README.md +3 -0
- package/image/index.d.ts +1 -0
- package/image/lib/image.service.d.ts +11 -0
- package/index.d.ts +1 -43
- package/memorize/README.md +3 -0
- package/memorize/index.d.ts +1 -0
- package/memorize/lib/memorize.decorator.d.ts +1 -0
- package/package.json +98 -5
- package/pipes/README.md +3 -0
- package/pipes/index.d.ts +1 -0
- package/pipes/lib/safe/safe.pipe.d.ts +10 -0
- package/platform/README.md +3 -0
- package/platform/index.d.ts +1 -0
- package/{lib/platform → platform/lib}/platform.service.d.ts +14 -6
- package/storage/README.md +3 -0
- package/storage/cookie-storage.service.d.ts +104 -0
- package/storage/index.d.ts +4 -0
- package/storage/local-storage.service.d.ts +16 -0
- package/storage/session-storage.service.d.ts +10 -0
- package/storage/storage.interface.d.ts +14 -0
- package/translation/README.md +3 -0
- package/translation/index.d.ts +8 -0
- package/translation/lib/translation-scope.resolver.d.ts +2 -0
- package/translation/lib/translation.config.d.ts +14 -0
- package/translation/lib/translation.loader.d.ts +14 -0
- package/translation/lib/translation.module.d.ts +8 -0
- package/translation/lib/translation.service.d.ts +31 -0
- package/translation/lib/translation.types.d.ts +10 -0
- package/translation/lib/translator.directive.d.ts +12 -0
- package/translation/lib/translator.pipe.d.ts +12 -0
- package/types/README.md +3 -0
- package/types/index.d.ts +2 -0
- package/utils/README.md +3 -0
- package/utils/index.d.ts +5 -0
- package/utils/lib/auto-unsubscribe.d.ts +12 -0
- package/utils/lib/color-util.d.ts +24 -0
- package/utils/lib/drawing-util.d.ts +18 -0
- package/utils/lib/html-util.d.ts +5 -0
- package/utils/lib/string-util.d.ts +6 -0
- package/validation/README.md +3 -0
- package/validation/index.d.ts +14 -0
- package/validation/lib/rules/between-rule.d.ts +18 -0
- package/validation/lib/rules/callback-rule.d.ts +23 -0
- package/validation/lib/rules/equal-rule.d.ts +17 -0
- package/validation/lib/rules/greater-than.d.ts +17 -0
- package/validation/lib/rules/length-rule.d.ts +17 -0
- package/validation/lib/rules/less-than-rule.d.ts +17 -0
- package/validation/lib/rules/maxlength-rule.d.ts +16 -0
- package/validation/lib/rules/minlength-rule.d.ts +16 -0
- package/validation/lib/rules/regex-rule.d.ts +17 -0
- package/validation/lib/rules/required-rule.d.ts +16 -0
- package/validation/lib/validation.config.d.ts +15 -0
- package/validation/lib/validation.module.d.ts +17 -0
- package/validation/lib/validation.service.d.ts +35 -0
- package/validation/lib/validation.types.d.ts +21 -0
- package/esm2022/lib/classes/base-page.class.mjs +0 -26
- package/esm2022/lib/classes/color.class.mjs +0 -49
- package/esm2022/lib/classes/datetime.class.mjs +0 -323
- package/esm2022/lib/classes/menu.class.mjs +0 -35
- package/esm2022/lib/classes/navigator.class.mjs +0 -2
- package/esm2022/lib/classes/popup.class.mjs +0 -2
- package/esm2022/lib/classes/promise.class.mjs +0 -21
- package/esm2022/lib/classes/sectionlist.class.mjs +0 -2
- package/esm2022/lib/classes/select.class.mjs +0 -8
- package/esm2022/lib/core.module.mjs +0 -27
- package/esm2022/lib/error/error.class.mjs +0 -2
- package/esm2022/lib/error/error.module.mjs +0 -19
- package/esm2022/lib/error/error.service.mjs +0 -22
- package/esm2022/lib/events/keyboard.mjs +0 -2
- package/esm2022/lib/http/http-error.class.mjs +0 -2
- package/esm2022/lib/http/http-events.interceptor.mjs +0 -3
- package/esm2022/lib/http/http-request.class.mjs +0 -2
- package/esm2022/lib/http/http-result.class.mjs +0 -25
- package/esm2022/lib/http/http.module.mjs +0 -35
- package/esm2022/lib/http/http.service.mjs +0 -148
- package/esm2022/lib/locale/en.json +0 -255
- package/esm2022/lib/locale/fa.json +0 -245
- package/esm2022/lib/pipe/datetime.pipe.mjs +0 -25
- package/esm2022/lib/pipe/htmlToText.pipe.mjs +0 -25
- package/esm2022/lib/platform/index.mjs +0 -2
- package/esm2022/lib/platform/platform.service.mjs +0 -152
- package/esm2022/lib/services/config.mjs +0 -29
- package/esm2022/lib/services/event.service.mjs +0 -34
- package/esm2022/lib/services/navigator.service.mjs +0 -10
- package/esm2022/lib/services/storage.service.mjs +0 -16
- package/esm2022/lib/translator/translator.mjs +0 -26
- package/esm2022/lib/translator/translator.module.mjs +0 -25
- package/esm2022/lib/translator/translator.pipe.mjs +0 -24
- package/esm2022/lib/translator/translator.service.mjs +0 -21
- package/esm2022/lib/utils/array/array-util.mjs +0 -133
- package/esm2022/lib/utils/html/html-util.mjs +0 -200
- package/esm2022/lib/utils/html/html.module.mjs +0 -19
- package/esm2022/lib/utils/math/math-util.mjs +0 -6
- package/esm2022/lib/utils/object/object-util.mjs +0 -83
- package/esm2022/lib/utils/render/on-demand-preload-strategy.service.mjs +0 -21
- package/esm2022/lib/utils/render/render.service.mjs +0 -109
- package/esm2022/lib/utils/render/rendering.module.mjs +0 -35
- package/esm2022/lib/utils/scroll/scroll.directive.mjs +0 -56
- package/esm2022/lib/utils/scroll/scroll.module.mjs +0 -19
- package/esm2022/lib/utils/separator/separator.module.mjs +0 -19
- package/esm2022/lib/utils/separator/separator.pipe.mjs +0 -33
- package/lib/classes/base-page.class.d.ts +0 -13
- package/lib/classes/color.class.d.ts +0 -17
- package/lib/classes/datetime.class.d.ts +0 -63
- package/lib/classes/menu.class.d.ts +0 -34
- package/lib/classes/navigator.class.d.ts +0 -5
- package/lib/classes/popup.class.d.ts +0 -12
- package/lib/classes/promise.class.d.ts +0 -7
- package/lib/classes/sectionlist.class.d.ts +0 -8
- package/lib/classes/select.class.d.ts +0 -7
- package/lib/core.module.d.ts +0 -9
- package/lib/error/error.class.d.ts +0 -4
- package/lib/error/error.module.d.ts +0 -7
- package/lib/error/error.service.d.ts +0 -13
- package/lib/events/keyboard.d.ts +0 -2
- package/lib/http/http-error.class.d.ts +0 -7
- package/lib/http/http-events.interceptor.d.ts +0 -10
- package/lib/http/http-request.class.d.ts +0 -14
- package/lib/http/http-result.class.d.ts +0 -11
- package/lib/http/http.module.d.ts +0 -10
- package/lib/http/http.service.d.ts +0 -23
- package/lib/pipe/datetime.pipe.d.ts +0 -8
- package/lib/pipe/htmlToText.pipe.d.ts +0 -7
- package/lib/platform/index.d.ts +0 -1
- package/lib/services/config.d.ts +0 -9
- package/lib/services/navigator.service.d.ts +0 -8
- package/lib/services/storage.service.d.ts +0 -7
- package/lib/translator/translator.d.ts +0 -9
- package/lib/translator/translator.module.d.ts +0 -8
- package/lib/translator/translator.pipe.d.ts +0 -8
- package/lib/translator/translator.service.d.ts +0 -8
- package/lib/utils/array/array-util.d.ts +0 -6
- package/lib/utils/html/html-util.d.ts +0 -62
- package/lib/utils/html/html.module.d.ts +0 -8
- package/lib/utils/math/math-util.d.ts +0 -3
- package/lib/utils/object/object-util.d.ts +0 -7
- package/lib/utils/render/on-demand-preload-strategy.service.d.ts +0 -10
- package/lib/utils/render/render.service.d.ts +0 -18
- package/lib/utils/render/rendering.module.d.ts +0 -8
- package/lib/utils/scroll/scroll.directive.d.ts +0 -18
- package/lib/utils/scroll/scroll.module.d.ts +0 -8
- package/lib/utils/separator/separator.module.d.ts +0 -8
- package/lib/utils/separator/separator.pipe.d.ts +0 -8
@@ -0,0 +1,337 @@
|
|
1
|
+
import { isBrowser } from '@acorex/core/platform';
|
2
|
+
import { translateSync } from '@acorex/core/translation';
|
3
|
+
import { defaults, orderBy } from 'lodash-es';
|
4
|
+
export class AXCalendar {
|
5
|
+
/**
|
6
|
+
* @ignore
|
7
|
+
*/
|
8
|
+
constructor(config) {
|
9
|
+
this._config = config;
|
10
|
+
}
|
11
|
+
get weekend() {
|
12
|
+
return this._config.weekend;
|
13
|
+
}
|
14
|
+
get formats() {
|
15
|
+
return this._config.formats;
|
16
|
+
}
|
17
|
+
get weekdays() {
|
18
|
+
return this._config.weekdays;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
export class AXDateTime {
|
22
|
+
get date() {
|
23
|
+
return this._date;
|
24
|
+
}
|
25
|
+
get calendar() {
|
26
|
+
return this._calendar;
|
27
|
+
}
|
28
|
+
constructor(value, calendar) {
|
29
|
+
//TODO: remove unused items
|
30
|
+
this._formatKeys = {
|
31
|
+
ss: () => this.pad(this.date.getSeconds(), 2),
|
32
|
+
s: () => this.date.getSeconds().toString(),
|
33
|
+
//
|
34
|
+
dd: () => this.pad(this.calendar.dayOfMonth(this.date), 2),
|
35
|
+
DD: () => this.pad(this.calendar.dayOfMonth(this.date), 2),
|
36
|
+
d: () => this.calendar.dayOfMonth(this.date).toString(),
|
37
|
+
//
|
38
|
+
mm: () => this.pad(this.date.getMinutes(), 2),
|
39
|
+
m: () => this.date.getMinutes().toString(),
|
40
|
+
//
|
41
|
+
MMMM: () => translateSync(`dateTime.months.${this.calendar.name()}.long.${this.calendar.monthOfYear(this.date) - 1}`),
|
42
|
+
MMM: () => translateSync(`dateTime.months.${this.calendar.name()}.short.${this.calendar.monthOfYear(this.date) - 1}`),
|
43
|
+
MM: () => this.pad(this.calendar.monthOfYear(this.date), 2),
|
44
|
+
M: () => this.calendar.monthOfYear(this.date),
|
45
|
+
//
|
46
|
+
E: () => translateSync(`dateTime.weekdays.long.${this.calendar.weekdays[this.calendar.dayOfWeek(this.date) - 1]}`),
|
47
|
+
DDD: () => translateSync(`dateTime.weekdays.short.${this.calendar.weekdays[this.calendar.dayOfWeek(this.date) - 1]}`),
|
48
|
+
DDDD: () => this._formatKeys['E'](),
|
49
|
+
//
|
50
|
+
yyyy: () => this.pad(this.calendar.year(this.date), 4),
|
51
|
+
YYYY: () => this.pad(this.calendar.year(this.date), 4),
|
52
|
+
yy: () => this.pad(this.calendar.year(this.date), 4).substring(2),
|
53
|
+
YY: () => this.pad(this.calendar.year(this.date), 4).substring(2),
|
54
|
+
//
|
55
|
+
HH: () => this.pad(this.date.getHours(), 2),
|
56
|
+
H: () => this.date.getHours().toString(),
|
57
|
+
//
|
58
|
+
hh: () => this.pad(this.date.getHours() % 12 || 12, 2),
|
59
|
+
h: () => (this.date.getHours() % 12 || 12).toString(),
|
60
|
+
//
|
61
|
+
A: () => (this.date.getHours() < 12 ? 'am' : 'pm'),
|
62
|
+
a: () => (this.date.getHours() < 12 ? 'am' : 'pm'),
|
63
|
+
date: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortDate')),
|
64
|
+
shortDate: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortDate')),
|
65
|
+
longDate: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'longDate')),
|
66
|
+
//
|
67
|
+
shortTime: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortTime')),
|
68
|
+
time: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortTime')),
|
69
|
+
longTime: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'longTime')),
|
70
|
+
//
|
71
|
+
datetime: (options) => this.format('date time', { locale: options.locale }),
|
72
|
+
};
|
73
|
+
this._language = () => (isBrowser() ? navigator.language : 'en-GB');
|
74
|
+
this._calendar = calendar;
|
75
|
+
this._date = value;
|
76
|
+
}
|
77
|
+
clone() {
|
78
|
+
return new AXDateTime(this.date, this.calendar);
|
79
|
+
}
|
80
|
+
get dayOfMonth() {
|
81
|
+
return this._calendar.dayOfMonth(this.date);
|
82
|
+
}
|
83
|
+
get dayOfYear() {
|
84
|
+
return this._calendar.dayOfYear(this.date);
|
85
|
+
}
|
86
|
+
get dayOfWeek() {
|
87
|
+
return this._calendar.dayOfWeek(this.date);
|
88
|
+
}
|
89
|
+
get hour() {
|
90
|
+
return this._date.getHours();
|
91
|
+
}
|
92
|
+
get minute() {
|
93
|
+
return this._date.getMinutes();
|
94
|
+
}
|
95
|
+
get second() {
|
96
|
+
return this._date.getSeconds();
|
97
|
+
}
|
98
|
+
get year() {
|
99
|
+
return this._calendar.year(this.date);
|
100
|
+
}
|
101
|
+
get monthOfYear() {
|
102
|
+
return this._calendar.monthOfYear(this.date);
|
103
|
+
}
|
104
|
+
get weekOfYear() {
|
105
|
+
return this._calendar.weekOfYear(this.date);
|
106
|
+
}
|
107
|
+
get month() {
|
108
|
+
return new AXCalendarMonth(this);
|
109
|
+
}
|
110
|
+
add(unit, amount) {
|
111
|
+
return this._calendar.add(this.date, unit, amount);
|
112
|
+
}
|
113
|
+
set(unit = 'day', value) {
|
114
|
+
return this._calendar.set(this.date, unit, value);
|
115
|
+
}
|
116
|
+
duration(end) {
|
117
|
+
const date = end instanceof AXDateTime ? end.date : end;
|
118
|
+
const val = new AXDateTime(date, this.calendar);
|
119
|
+
const range = new AXDateTimeRange(this, val);
|
120
|
+
return range.duration();
|
121
|
+
}
|
122
|
+
startOf(unit = 'day') {
|
123
|
+
return this._calendar.startOf(this.date, unit);
|
124
|
+
}
|
125
|
+
endOf(unit = 'day') {
|
126
|
+
return this._calendar.endOf(this.date, unit);
|
127
|
+
}
|
128
|
+
format(format = this.getDateTimeFormatByLocale(this._language(), 'shortDate'), options) {
|
129
|
+
const effectiveOptions = defaults({}, options, {
|
130
|
+
locale: this._language(),
|
131
|
+
});
|
132
|
+
const re = new RegExp(orderBy(Object.keys(this._formatKeys), (c) => c.length, ['desc']).join('|'), 'gi');
|
133
|
+
return format.replace(re, (matched) => {
|
134
|
+
const f = this._formatKeys[matched];
|
135
|
+
const r = f(effectiveOptions);
|
136
|
+
return r;
|
137
|
+
});
|
138
|
+
}
|
139
|
+
getDateTimeFormatByLocale(locale, style) {
|
140
|
+
let options = {};
|
141
|
+
switch (style) {
|
142
|
+
case 'shortDate': // Year, Month, Day
|
143
|
+
options = { year: 'numeric', month: '2-digit', day: '2-digit' };
|
144
|
+
break;
|
145
|
+
case 'longDate': // Weekday, Month name, Day, Year
|
146
|
+
options = {
|
147
|
+
weekday: 'long',
|
148
|
+
year: 'numeric',
|
149
|
+
month: 'long',
|
150
|
+
day: 'numeric',
|
151
|
+
};
|
152
|
+
break;
|
153
|
+
case 'shortTime': // Hour, Minute
|
154
|
+
options = { hour: '2-digit', minute: '2-digit', hour12: false };
|
155
|
+
break;
|
156
|
+
case 'longTime': // Hour, Minute, Second
|
157
|
+
options = {
|
158
|
+
hour: '2-digit',
|
159
|
+
minute: '2-digit',
|
160
|
+
second: '2-digit',
|
161
|
+
hour12: false,
|
162
|
+
};
|
163
|
+
break;
|
164
|
+
}
|
165
|
+
const formatter = new Intl.DateTimeFormat(locale, options);
|
166
|
+
// Get parts of the date and/or time
|
167
|
+
const parts = formatter.formatToParts(new Date());
|
168
|
+
// Map parts to their respective format
|
169
|
+
const formatMap = {
|
170
|
+
day: 'dd',
|
171
|
+
month: style == 'longDate' ? 'MMMM' : 'MM',
|
172
|
+
year: 'yyyy',
|
173
|
+
hour: 'HH',
|
174
|
+
minute: 'mm',
|
175
|
+
second: 'ss',
|
176
|
+
weekday: 'E',
|
177
|
+
literal: '',
|
178
|
+
};
|
179
|
+
// Construct the date and/or time format string
|
180
|
+
return parts
|
181
|
+
.map((part) => {
|
182
|
+
if (part.type === 'literal') {
|
183
|
+
// Use the literal part directly as separator
|
184
|
+
return part.value;
|
185
|
+
}
|
186
|
+
else {
|
187
|
+
return formatMap[part.type] || part.value;
|
188
|
+
}
|
189
|
+
})
|
190
|
+
.join('');
|
191
|
+
}
|
192
|
+
pad(n, width, z = '0') {
|
193
|
+
n = n + '';
|
194
|
+
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
195
|
+
}
|
196
|
+
equal(value, unit = 'day') {
|
197
|
+
return this.compare(value, unit) == 0;
|
198
|
+
}
|
199
|
+
compare(value, unit = 'day') {
|
200
|
+
const date = value instanceof AXDateTime ? value.date : value;
|
201
|
+
const val = new AXDateTime(date, this.calendar);
|
202
|
+
const func = (v1, v2) => {
|
203
|
+
if (v1 == v2) {
|
204
|
+
return 0;
|
205
|
+
}
|
206
|
+
else if (v1 > v2) {
|
207
|
+
return 1;
|
208
|
+
}
|
209
|
+
else {
|
210
|
+
return -1;
|
211
|
+
}
|
212
|
+
};
|
213
|
+
let p = 0;
|
214
|
+
switch (unit) {
|
215
|
+
case 'year':
|
216
|
+
return func(this.year, val.year);
|
217
|
+
case 'week':
|
218
|
+
p = this.compare(val, 'year');
|
219
|
+
return p == 0 ? func(this.weekOfYear, val.weekOfYear) : p;
|
220
|
+
case 'month':
|
221
|
+
p = this.compare(val, 'year');
|
222
|
+
return p == 0 ? func(this.monthOfYear, val.monthOfYear) : p;
|
223
|
+
case 'day':
|
224
|
+
p = this.compare(val, 'year');
|
225
|
+
return p == 0 ? func(this.dayOfYear, val.dayOfYear) : p;
|
226
|
+
case 'hour':
|
227
|
+
p = this.compare(val, 'day');
|
228
|
+
return p == 0 ? func(this.hour, val.hour) : p;
|
229
|
+
case 'minute':
|
230
|
+
p = this.compare(val, 'hour');
|
231
|
+
return p == 0 ? func(this.minute, val.minute) : p;
|
232
|
+
case 'second':
|
233
|
+
p = this.compare(val, 'minute');
|
234
|
+
return p == 0 ? func(this.second, val.second) : p;
|
235
|
+
default:
|
236
|
+
return func(this.date.getTime(), val.date.getTime());
|
237
|
+
}
|
238
|
+
}
|
239
|
+
}
|
240
|
+
export class AXCalendarMonth {
|
241
|
+
get range() {
|
242
|
+
return this._range;
|
243
|
+
}
|
244
|
+
set range(v) {
|
245
|
+
this._range = v;
|
246
|
+
}
|
247
|
+
get totalDays() {
|
248
|
+
return this.range.endTime.dayOfMonth;
|
249
|
+
}
|
250
|
+
constructor(date) {
|
251
|
+
this.index = date.date.getMonth();
|
252
|
+
this.name = date.format('MMMM');
|
253
|
+
this.range = new AXDateTimeRange(new AXDateTime(date.startOf('month').date, date.calendar), new AXDateTime(date.endOf('month').date, date.calendar));
|
254
|
+
}
|
255
|
+
}
|
256
|
+
export class AXDateTimeRange {
|
257
|
+
get startTime() {
|
258
|
+
return this._startTime;
|
259
|
+
}
|
260
|
+
get endTime() {
|
261
|
+
return this._endTime;
|
262
|
+
}
|
263
|
+
constructor(startTime, endTime) {
|
264
|
+
this._startTime = startTime;
|
265
|
+
this._endTime = endTime;
|
266
|
+
}
|
267
|
+
duration() {
|
268
|
+
const result = {
|
269
|
+
miliseconds: 0,
|
270
|
+
seconds: 0,
|
271
|
+
minutes: 0,
|
272
|
+
hours: 0,
|
273
|
+
days: 0,
|
274
|
+
months: 0,
|
275
|
+
years: 0,
|
276
|
+
total: {
|
277
|
+
miliseconds: 0,
|
278
|
+
seconds: 0,
|
279
|
+
minutes: 0,
|
280
|
+
hours: 0,
|
281
|
+
days: 0,
|
282
|
+
weeks: 0,
|
283
|
+
months: 0,
|
284
|
+
years: 0,
|
285
|
+
},
|
286
|
+
};
|
287
|
+
const one_second = 1000;
|
288
|
+
const one_min = one_second * 60;
|
289
|
+
const one_hour = one_min * 60;
|
290
|
+
const one_day = one_hour * 24;
|
291
|
+
const one_week = one_day * 7;
|
292
|
+
const one_year = 365.25 * one_day;
|
293
|
+
const one_month = one_year / 12;
|
294
|
+
const startTime = this._startTime.date.getTime();
|
295
|
+
const endTime = this._endTime.date.getTime();
|
296
|
+
const diff = Math.abs(endTime - startTime);
|
297
|
+
//
|
298
|
+
result.total.miliseconds = diff;
|
299
|
+
result.total.seconds = Number((diff / one_second).toFixed(2));
|
300
|
+
result.total.minutes = Number((diff / one_min).toFixed(2));
|
301
|
+
result.total.hours = Number((diff / one_hour).toFixed(2));
|
302
|
+
result.total.days = Number((diff / one_day).toFixed(2));
|
303
|
+
result.total.weeks = Number((diff / one_week).toFixed(2));
|
304
|
+
//
|
305
|
+
// let months = (this.endTime.year - this.startTime.year) * 12;
|
306
|
+
// months += this.endTime.monthOfYear - this.startTime.monthOfYear + 1;
|
307
|
+
// if (this.endTime.dayOfYear < this.startTime.dayOfYear) {
|
308
|
+
// months--;
|
309
|
+
// }
|
310
|
+
// result.total.months = Math.abs(months);
|
311
|
+
// TODO: review
|
312
|
+
result.total.months = Number((diff / one_month).toFixed(2));
|
313
|
+
result.total.years = Number((diff / one_year).toFixed(2));
|
314
|
+
//
|
315
|
+
result.miliseconds = result.total.miliseconds % 1000;
|
316
|
+
result.seconds = Number((result.total.seconds % 60).toFixed(0));
|
317
|
+
result.minutes = Number((result.total.minutes % 60).toFixed(0));
|
318
|
+
result.hours = Number((result.total.hours % 24).toFixed(0));
|
319
|
+
// TODO: review
|
320
|
+
result.days = Number((result.total.days % 30.4).toFixed(0));
|
321
|
+
result.months = Number((result.total.months % 12).toFixed(0));
|
322
|
+
result.years = Number(result.total.years.toFixed(0));
|
323
|
+
return result;
|
324
|
+
}
|
325
|
+
enumurate(unit = 'day', amount = 1) {
|
326
|
+
const result = [];
|
327
|
+
let item = this._startTime.clone();
|
328
|
+
while (item.compare(this._endTime, unit) < 1) {
|
329
|
+
if (!result.some((c) => c.equal(item, unit))) {
|
330
|
+
result.push(item);
|
331
|
+
}
|
332
|
+
item = item.add(unit, amount);
|
333
|
+
}
|
334
|
+
return result;
|
335
|
+
}
|
336
|
+
}
|
337
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXRpbWUuY2xhc3MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvZGF0ZS10aW1lL3NyYy9saWIvZGF0ZXRpbWUuY2xhc3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ2xELE9BQU8sRUFBRSxhQUFhLEVB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DApKTtcbiAgICByZXN1bHQuaG91cnMgPSBOdW1iZXIoKHJlc3VsdC50b3RhbC5ob3VycyAlIDI0KS50b0ZpeGVkKDApKTtcbiAgICAvLyBUT0RPOiByZXZpZXdcbiAgICByZXN1bHQuZGF5cyA9IE51bWJlcigocmVzdWx0LnRvdGFsLmRheXMgJSAzMC40KS50b0ZpeGVkKDApKTtcbiAgICByZXN1bHQubW9udGhzID0gTnVtYmVyKChyZXN1bHQudG90YWwubW9udGhzICUgMTIpLnRvRml4ZWQoMCkpO1xuICAgIHJlc3VsdC55ZWFycyA9IE51bWJlcihyZXN1bHQudG90YWwueWVhcnMudG9GaXhlZCgwKSk7XG4gICAgcmV0dXJuIHJlc3VsdDtcbiAgfVxuXG4gIGVudW11cmF0ZSh1bml0OiBUaW1lVW5pdCA9ICdkYXknLCBhbW91bnQgPSAxKTogQVhEYXRlVGltZVtdIHtcbiAgICBjb25zdCByZXN1bHQ6IEFYRGF0ZVRpbWVbXSA9IFtdO1xuICAgIGxldCBpdGVtID0gdGhpcy5fc3RhcnRUaW1lLmNsb25lKCk7XG4gICAgd2hpbGUgKGl0ZW0uY29tcGFyZSh0aGlzLl9lbmRUaW1lLCB1bml0KSA8IDEpIHtcbiAgICAgIGlmICghcmVzdWx0LnNvbWUoKGMpID0+IGMuZXF1YWwoaXRlbSwgdW5pdCkpKSB7XG4gICAgICAgIHJlc3VsdC5wdXNoKGl0ZW0pO1xuICAgICAgfVxuICAgICAgaXRlbSA9IGl0ZW0uYWRkKHVuaXQsIGFtb3VudCk7XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbn1cbiJdfQ==
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { AXFormatModule } from '@acorex/core/format';
|
2
|
+
import { NgModule } from '@angular/core';
|
3
|
+
import { AXDateTimeFormatter } from './formatters/datetime-formatter';
|
4
|
+
import { AXTimeLeftFormatter } from './formatters/timeleft-formatter';
|
5
|
+
import { AXDateTimePipe } from './datetime.pipe';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
import * as i1 from "@acorex/core/format";
|
8
|
+
export class AXDateTimeModule {
|
9
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
10
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimeModule, declarations: [AXDateTimePipe], imports: [i1.AXFormatModule], exports: [AXDateTimePipe] }); }
|
11
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimeModule, imports: [AXFormatModule.forChild({
|
12
|
+
formatters: [AXDateTimeFormatter, AXTimeLeftFormatter],
|
13
|
+
})] }); }
|
14
|
+
}
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimeModule, decorators: [{
|
16
|
+
type: NgModule,
|
17
|
+
args: [{
|
18
|
+
imports: [
|
19
|
+
AXFormatModule.forChild({
|
20
|
+
formatters: [AXDateTimeFormatter, AXTimeLeftFormatter],
|
21
|
+
}),
|
22
|
+
],
|
23
|
+
exports: [AXDateTimePipe],
|
24
|
+
declarations: [AXDateTimePipe],
|
25
|
+
}]
|
26
|
+
}] });
|
27
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXRpbWUubW9kdWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL2RhdGUtdGltZS9zcmMvbGliL2RhdGV0aW1lLm1vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDck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GVycy90aW1lbGVmdC1mb3JtYXR0ZXInO1xuaW1wb3J0IHsgQVhEYXRlVGltZVBpcGUgfSBmcm9tICcuL2RhdGV0aW1lLnBpcGUnO1xuXG5ATmdNb2R1bGUoe1xuICBpbXBvcnRzOiBbXG4gICAgQVhGb3JtYXRNb2R1bGUuZm9yQ2hpbGQoe1xuICAgICAgZm9ybWF0dGVyczogW0FYRGF0ZVRpbWVGb3JtYXR0ZXIsIEFYVGltZUxlZnRGb3JtYXR0ZXJdLFxuICAgIH0pLFxuICBdLFxuICBleHBvcnRzOiBbQVhEYXRlVGltZVBpcGVdLFxuICBkZWNsYXJhdGlvbnM6IFtBWERhdGVUaW1lUGlwZV0sXG59KVxuZXhwb3J0IGNsYXNzIEFYRGF0ZVRpbWVNb2R1bGUge31cbiJdfQ==
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Pipe, inject } from '@angular/core';
|
2
|
+
import { AXCalendarService } from './calendar.service';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
/**
|
5
|
+
* @deprecated The pipe should not be used, use format instead
|
6
|
+
*/
|
7
|
+
export class AXDateTimePipe {
|
8
|
+
constructor() {
|
9
|
+
this._calendarService = inject(AXCalendarService);
|
10
|
+
}
|
11
|
+
transform(value, format, calendarName) {
|
12
|
+
if (value == null) {
|
13
|
+
return '';
|
14
|
+
}
|
15
|
+
let calendar = this._calendarService.calendar;
|
16
|
+
if (calendarName) {
|
17
|
+
calendar = this._calendarService.resolveCalendar(calendarName);
|
18
|
+
}
|
19
|
+
const val = this._calendarService.convert(value, calendar.name());
|
20
|
+
return val.format(format);
|
21
|
+
}
|
22
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
23
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimePipe, name: "axDate" }); }
|
24
|
+
}
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimePipe, decorators: [{
|
26
|
+
type: Pipe,
|
27
|
+
args: [{ name: 'axDate' }]
|
28
|
+
}] });
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXRpbWUucGlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9kYXRlLXRpbWUvc3JjL2xpYi9kYXRldGltZS5waXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxJQUFJLEVBQWlCLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUM1RCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQzs7QUFHdkQ7O0dBRUc7QUFFSCxNQUFNLE9BQU8sY0FBYztJQUQzQjtRQUVVLHFCQUFnQixHQUFzQixNQUFNLENBQUMsaUJBQWlCLENBQUMsQ0FBQztLQW9CekU7SUFsQkMsU0FBUyxDQUNQLEtBQWlDLEVBQ2pDLE1BQWUsRUFDZixZQUFxQjtRQUVyQixJQUFJLEtBQUssSUFBSSxJQUFJLEVBQUUsQ0FBQztZQUNsQixPQUFPLEVBQUUsQ0FBQztRQUNaLENBQUM7UUFDRCxJQUFJLFFBQVEsR0FBRyxJQUFJLENBQUMsZ0JBQWdCLENBQUMsUUFBUSxDQUFDO1FBQzlDLElBQUksWUFBWSxFQUFFLENBQUM7WUFDakIsUUFBUSxHQUFHLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxlQUFlLENBQUMsWUFBWSxDQUFDLENBQUM7UUFDakUsQ0FBQztRQUNELE1BQU0sR0FBRyxHQUFlLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxPQUFP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aGlzLl9jYWxlbmRhclNlcnZpY2UuY2FsZW5kYXI7XG4gICAgaWYgKGNhbGVuZGFyTmFtZSkge1xuICAgICAgY2FsZW5kYXIgPSB0aGlzLl9jYWxlbmRhclNlcnZpY2UucmVzb2x2ZUNhbGVuZGFyKGNhbGVuZGFyTmFtZSk7XG4gICAgfVxuICAgIGNvbnN0IHZhbDogQVhEYXRlVGltZSA9IHRoaXMuX2NhbGVuZGFyU2VydmljZS5jb252ZXJ0KFxuICAgICAgdmFsdWUsXG4gICAgICBjYWxlbmRhci5uYW1lKClcbiAgICApO1xuICAgIHJldHVybiB2YWwuZm9ybWF0KGZvcm1hdCk7XG4gIH1cbn1cbiJdfQ==
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { Injectable, inject } from '@angular/core';
|
2
|
+
import { AXCalendarService } from '../calendar.service';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export class AXDateTimeFormatter {
|
5
|
+
constructor() {
|
6
|
+
this.calendarService = inject(AXCalendarService);
|
7
|
+
}
|
8
|
+
get name() {
|
9
|
+
return 'datetime';
|
10
|
+
}
|
11
|
+
format(value, options) {
|
12
|
+
const effectiveOptions = typeof options == 'object'
|
13
|
+
? {
|
14
|
+
format: options.format ?? 'date',
|
15
|
+
locale: options.locale,
|
16
|
+
calendar: options.calendar ?? this.calendarService.calendar.name(),
|
17
|
+
}
|
18
|
+
: {
|
19
|
+
format: options,
|
20
|
+
calendar: this.calendarService.calendar.name(),
|
21
|
+
};
|
22
|
+
return this.calendarService
|
23
|
+
.create(value, effectiveOptions.calendar)
|
24
|
+
.format(effectiveOptions.format, { locale: effectiveOptions.locale });
|
25
|
+
}
|
26
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimeFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
27
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimeFormatter }); }
|
28
|
+
}
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXDateTimeFormatter, decorators: [{
|
30
|
+
type: Injectable
|
31
|
+
}] });
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZXRpbWUtZm9ybWF0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL2RhdGUtdGltZS9zcmMvbGliL2Zvcm1hdHRlcnMvZGF0ZXRpbWUtZm9ybWF0dGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ25ELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHFCQUFxQixDQUFDOztBQWV4RCxNQUFNLE9BQU8sbUJBQW1CO0lBRGhDO1FBRVUsb0JBQWUsR0FBRyxNQUFNLENBQUMsaUJBQWlCLENBQUMsQ0FBQztLQTBCckQ7SUF4QkMsSUFBSSxJQUFJO1FBQ04sT0FBTyxVQUFVLENBQUM7SUFDcEIsQ0FBQztJQUVELE1BQU0sQ0FDSixLQUFjLEVBQ2QsT0FBNkM7UUFFN0MsTUFBTSxnQkFBZ0IsR0FDcEIsT0FBTyxPQUFPLElBQUksUUFBUTtZQUN4QixDQUFDLENBQUM7Z0JBQ0UsTUFBTSxFQUFFLE9BQU8sQ0FBQyxNQUFNLElBQUksTUFBTTtnQkFDaEMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxNQUFNO2dCQUN0QixRQUFRLEVBQUUsT0FBTyxDQUFDLFFBQVEsSUFBSSxJQUFJLENBQUMsZUFBZSxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUU7YUFDbkU7WU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b25zLmxvY2FsZSB9KTtcbiAgfVxufVxuIl19
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import { isNil } from 'lodash-es';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export class AXTimeLeftFormatter {
|
5
|
+
get name() {
|
6
|
+
return 'timeleft';
|
7
|
+
}
|
8
|
+
format(value, options) {
|
9
|
+
const milliseconds = Number(value);
|
10
|
+
if (milliseconds === null || isNaN(milliseconds)) {
|
11
|
+
return 'Calculating...';
|
12
|
+
}
|
13
|
+
const durationInSeconds = Math.round(milliseconds / 1000);
|
14
|
+
let format = options?.format;
|
15
|
+
// Determine the best format if format is null
|
16
|
+
if (isNil(format)) {
|
17
|
+
if (durationInSeconds < 45)
|
18
|
+
format = 's';
|
19
|
+
else if (durationInSeconds < 60 * 45)
|
20
|
+
format = 'm';
|
21
|
+
else if (durationInSeconds < 60 * 60 * 22)
|
22
|
+
format = 'h';
|
23
|
+
else if (durationInSeconds < 60 * 60 * 24 * 26)
|
24
|
+
format = 'd';
|
25
|
+
else if (durationInSeconds < 60 * 60 * 24 * 320)
|
26
|
+
format = 'M';
|
27
|
+
else
|
28
|
+
format = 'y';
|
29
|
+
}
|
30
|
+
// Helper function for zero-padding
|
31
|
+
const pad = (num) => num.toString().padStart(2, '0');
|
32
|
+
switch (format) {
|
33
|
+
case 's':
|
34
|
+
return `${durationInSeconds} seconds left`;
|
35
|
+
case 'ss':
|
36
|
+
return `${pad(durationInSeconds)} seconds left`;
|
37
|
+
case 'm':
|
38
|
+
return `${Math.round(durationInSeconds / 60)} minute${durationInSeconds >= 120 ? 's' : ''} left`;
|
39
|
+
case 'mm':
|
40
|
+
return `${pad(Math.round(durationInSeconds / 60))} minutes left`;
|
41
|
+
case 'h':
|
42
|
+
case 'H':
|
43
|
+
if (durationInSeconds < 60 * 89)
|
44
|
+
return 'an hour left';
|
45
|
+
return `${Math.round(durationInSeconds / 3600)} hour${durationInSeconds >= 60 * 180 ? 's' : ''} left`;
|
46
|
+
case 'hh':
|
47
|
+
case 'HH':
|
48
|
+
if (durationInSeconds < 60 * 89)
|
49
|
+
return '01 hour left';
|
50
|
+
return `${pad(Math.round(durationInSeconds / 3600))} hours left`;
|
51
|
+
case 'd':
|
52
|
+
case 'D':
|
53
|
+
if (durationInSeconds < 60 * 60 * 35)
|
54
|
+
return 'a day left';
|
55
|
+
return `${Math.round(durationInSeconds / (3600 * 24))} day${durationInSeconds >= 60 * 60 * 70 ? 's' : ''} left`;
|
56
|
+
case 'dd':
|
57
|
+
case 'DD':
|
58
|
+
if (durationInSeconds < 60 * 60 * 35)
|
59
|
+
return '01 day left';
|
60
|
+
return `${pad(Math.round(durationInSeconds / (3600 * 24)))} days left`;
|
61
|
+
case 'M':
|
62
|
+
if (durationInSeconds < 60 * 60 * 24 * 45)
|
63
|
+
return 'a month left';
|
64
|
+
return `${Math.round(durationInSeconds / (3600 * 24 * 30))} month${durationInSeconds >= 60 * 60 * 24 * 90 ? 's' : ''} left`;
|
65
|
+
case 'MM':
|
66
|
+
if (durationInSeconds < 60 * 60 * 24 * 45)
|
67
|
+
return '01 month left';
|
68
|
+
return `${pad(Math.round(durationInSeconds / (3600 * 24 * 30)))} months left`;
|
69
|
+
case 'y':
|
70
|
+
case 'Y':
|
71
|
+
if (durationInSeconds < 60 * 60 * 24 * 547)
|
72
|
+
return 'a year left';
|
73
|
+
return `${Math.round(durationInSeconds / (3600 * 24 * 365))} year${durationInSeconds >= 60 * 60 * 24 * 730 ? 's' : ''} left`;
|
74
|
+
case 'yy':
|
75
|
+
case 'YY':
|
76
|
+
case 'yyyy':
|
77
|
+
case 'YYYY':
|
78
|
+
if (durationInSeconds < 60 * 60 * 24 * 547)
|
79
|
+
return '01 year left';
|
80
|
+
return `${pad(Math.round(durationInSeconds / (3600 * 24 * 365)))} years left`;
|
81
|
+
default:
|
82
|
+
return 'Invalid format';
|
83
|
+
}
|
84
|
+
}
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTimeLeftFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
86
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTimeLeftFormatter }); }
|
87
|
+
}
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: AXTimeLeftFormatter, decorators: [{
|
89
|
+
type: Injectable
|
90
|
+
}] });
|
91
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGltZWxlZnQtZm9ybWF0dGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL2RhdGUtdGltZS9zcmMvbGliL2Zvcm1hdHRlcnMvdGltZWxlZnQtZm9ybWF0dGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLEtBQUssRUFBRSxNQUFNLFdBQVcsQ0FBQzs7QUFjbEMsTUFBTSxPQUFPLG1CQUFtQjtJQUM5QixJQUFJLElBQUk7UUFDTixPQUFPLFVBQVUsQ0FBQztJQUNwQixDQUFDO0lBRUQsTUFBTSxDQUFDLEtBQXNCLEVBQUUsT0FBb0M7UUFDakUsTUFBTSxZQUFZLEdBQUcsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDO1FBQ25DLElBQUksWUFBWSxLQUFLLElBQUksSUFBSSxLQUFLLENBQUMsWUFBWSxDQUFDLEVBQUUsQ0FBQztZQUNqRCxPQUFPLGdCQUFnQixDQUFDO1FBQzFCLENBQUM7UUFDRCxNQUFNLGlCQUFpQixHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsWUFB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