@spicainternational/ngx-sds-components 7.6.1 → 7.7.1
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/esm2020/src/lib/date-pipes/date-pipes.module.mjs +8 -4
- package/esm2020/src/lib/date-pipes/date-time-range-duration.pipe.mjs +31 -0
- package/esm2020/src/lib/date-pipes/date-time-range-format.pipe.mjs +6 -2
- package/esm2020/src/lib/date-pipes/public-api.mjs +2 -1
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-pipes.mjs +41 -6
- package/fesm2015/spicainternational-ngx-sds-components-src-lib-date-pipes.mjs.map +1 -1
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-pipes.mjs +41 -6
- package/fesm2020/spicainternational-ngx-sds-components-src-lib-date-pipes.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/date-pipes/date-pipes.module.d.ts +3 -2
- package/src/lib/date-pipes/date-time-range-duration.pipe.d.ts +7 -0
- package/src/lib/date-pipes/public-api.d.ts +1 -0
|
@@ -4,12 +4,14 @@ import { SdsDatePeriodFormatPipe } from './date-period-format.pipe';
|
|
|
4
4
|
import { SdsDateFormatPipe } from './date-format.pipe';
|
|
5
5
|
import { DateTimeRangeFormatPipe } from './date-time-range-format.pipe';
|
|
6
6
|
import { SdsDateComparePipe } from './date-compare.pipe';
|
|
7
|
+
import { SdsDateTimeRangeDurationPipe } from './date-time-range-duration.pipe';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
const pipes = [
|
|
9
10
|
SdsDatePeriodFormatPipe,
|
|
10
11
|
SdsDateFormatPipe,
|
|
11
12
|
DateTimeRangeFormatPipe,
|
|
12
|
-
SdsDateComparePipe
|
|
13
|
+
SdsDateComparePipe,
|
|
14
|
+
SdsDateTimeRangeDurationPipe
|
|
13
15
|
];
|
|
14
16
|
export class SdsDatePipesModule {
|
|
15
17
|
}
|
|
@@ -17,10 +19,12 @@ SdsDatePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versi
|
|
|
17
19
|
SdsDatePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, declarations: [SdsDatePeriodFormatPipe,
|
|
18
20
|
SdsDateFormatPipe,
|
|
19
21
|
DateTimeRangeFormatPipe,
|
|
20
|
-
SdsDateComparePipe
|
|
22
|
+
SdsDateComparePipe,
|
|
23
|
+
SdsDateTimeRangeDurationPipe], imports: [CommonModule], exports: [SdsDatePeriodFormatPipe,
|
|
21
24
|
SdsDateFormatPipe,
|
|
22
25
|
DateTimeRangeFormatPipe,
|
|
23
|
-
SdsDateComparePipe
|
|
26
|
+
SdsDateComparePipe,
|
|
27
|
+
SdsDateTimeRangeDurationPipe] });
|
|
24
28
|
SdsDatePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, imports: [CommonModule] });
|
|
25
29
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, decorators: [{
|
|
26
30
|
type: NgModule,
|
|
@@ -36,4 +40,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
36
40
|
]
|
|
37
41
|
}]
|
|
38
42
|
}] });
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS1waXBlcy5tb2R1bGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9uZ3gtc2RzLWNvbXBvbmVudHMvc3JjL2xpYi9kYXRlLXBpcGVzL2RhdGUtcGlwZXMubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE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J0IGNsYXNzIFNkc0RhdGVQaXBlc01vZHVsZSB7IH1cclxuIl19
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Pipe } from '@angular/core';
|
|
2
|
+
import differenceInMinutes from 'date-fns/differenceInMinutes';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export class SdsDateTimeRangeDurationPipe {
|
|
5
|
+
transform(startDate, endDate) {
|
|
6
|
+
if (!startDate || !endDate) {
|
|
7
|
+
return '';
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const start = new Date(startDate);
|
|
11
|
+
const end = new Date(endDate);
|
|
12
|
+
// const formatter = new Intl.DurationFormat(locales, options);
|
|
13
|
+
const totalMinutes = differenceInMinutes(end, start);
|
|
14
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
15
|
+
const minutes = totalMinutes % 60;
|
|
16
|
+
return `${hours}:${minutes.toString().padStart(2, '0')}`;
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
return '';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
SdsDateTimeRangeDurationPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
24
|
+
SdsDateTimeRangeDurationPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, name: "sdsDateTimeRangeDuration" });
|
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, decorators: [{
|
|
26
|
+
type: Pipe,
|
|
27
|
+
args: [{
|
|
28
|
+
name: 'sdsDateTimeRangeDuration',
|
|
29
|
+
}]
|
|
30
|
+
}] });
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2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gICAgICAgICAgICBcclxuICAgICAgICAgICAgLy8gY29uc3QgZm9ybWF0dGVyID0gbmV3IEludGwuRHVyYXRpb25Gb3JtYXQobG9jYWxlcywgb3B0aW9ucyk7XHJcblxyXG4gICAgICAgICAgICBjb25zdCB0b3RhbE1pbnV0ZXMgPSBkaWZmZXJlbmNlSW5NaW51dGVzKGVuZCwgc3RhcnQpO1xyXG4gICAgICAgICAgICBjb25zdCBob3VycyA9IE1hdGguZmxvb3IodG90YWxNaW51dGVzIC8gNjApO1xyXG4gICAgICAgICAgICBjb25zdCBtaW51dGVzID0gdG90YWxNaW51dGVzICUgNjA7XHJcblxyXG4gICAgICAgICAgICByZXR1cm4gYCR7aG91cnN9OiR7bWludXRlcy50b1N0cmluZygpLnBhZFN0YXJ0KDIsICcwJyl9YDtcclxuICAgICAgICB9IGNhdGNoIChlcnJvcikge1xyXG4gICAgICAgICAgICByZXR1cm4gJyc7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbiJdfQ==
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Pipe } from '@angular/core';
|
|
2
|
+
import { addDays, startOfDay } from 'date-fns';
|
|
2
3
|
import * as i0 from "@angular/core";
|
|
3
4
|
export class DateTimeRangeFormatPipe {
|
|
4
5
|
/**
|
|
@@ -15,13 +16,16 @@ export class DateTimeRangeFormatPipe {
|
|
|
15
16
|
}
|
|
16
17
|
try {
|
|
17
18
|
const start = new Date(startDate);
|
|
18
|
-
|
|
19
|
+
let end = new Date(endDate);
|
|
19
20
|
if (!options || isNaN(start.getTime()) || isNaN(end.getTime())) {
|
|
20
21
|
return '';
|
|
21
22
|
}
|
|
22
23
|
const formatter = new Intl.DateTimeFormat(locales, options);
|
|
23
24
|
const formatterWithRange = formatter;
|
|
24
25
|
if (typeof formatterWithRange.formatRange === 'function') {
|
|
26
|
+
if (startOfDay(addDays(start, 1)).getTime() === end.getTime()) {
|
|
27
|
+
end = addDays(end, -1);
|
|
28
|
+
}
|
|
25
29
|
return formatterWithRange.formatRange(start, end);
|
|
26
30
|
}
|
|
27
31
|
else {
|
|
@@ -41,4 +45,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
41
45
|
name: 'sdsDateTimeRangeFormat',
|
|
42
46
|
}]
|
|
43
47
|
}] });
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0ZS10aW1lLXJhbmdlLWZvcm1hdC5waXBlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvbmd4LXNkcy1jb21wb25lbnRzL3NyYy9saWIvZGF0ZS1waXBlcy9kYXRlLXRpbWUtcmFuZ2UtZm9ybWF0LnBpcGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBaUIsTUFBTSxlQUFlLENBQUM7QUFDcEQsT0FBTyxFQUFFLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxVQUFVLENBQUM7O0FBSy9DLE1BQU0sT0FBTyx1QkFBdUI7SUFDaEM7Ozs7Ozs7T0FPRztJQUNILFNBQVMsQ0FDTCxTQUFpQyxFQUNqQyxPQUErQixFQUMvQixPQUEwQixFQUMxQixPQUFtQztRQUVuQyxJQUFJLENBQUMsU0FBUyxJQUFJLENBQUMsT0FBTyxFQUFFO1lBQ3hCLE9BQU8sRUFBRSxDQUFDO1NBQ2I7UUFFRCxJQUFJO1lBQ0EsTUFBTSxLQUFLLEdBQUcsSUFBSSxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUM7WUFDbEMsSUFBSSxHQUFHLEdBQUcsSUFBSSxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUM7WUFFNUIsSUFBSSxDQUFDLE9BQU8sSUFBSSxLQUFLLENBQUMsS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cm1hdE9wdGlvbnNcclxuICAgICk6IHN0cmluZyB7XHJcbiAgICAgICAgaWYgKCFzdGFydERhdGUgfHwgIWVuZERhdGUpIHtcclxuICAgICAgICAgICAgcmV0dXJuICcnO1xyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgY29uc3Qgc3RhcnQgPSBuZXcgRGF0ZShzdGFydERhdGUpO1xyXG4gICAgICAgICAgICBsZXQgZW5kID0gbmV3IERhdGUoZW5kRGF0ZSk7XHJcblxyXG4gICAgICAgICAgICBpZiAoIW9wdGlvbnMgfHwgaXNOYU4oc3RhcnQuZ2V0VGltZSgpKSB8fCBpc05hTihlbmQuZ2V0VGltZSgpKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuICcnO1xyXG4gICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICBjb25zdCBmb3JtYXR0ZXIgPSBuZXcgSW50bC5EYXRlVGltZUZvcm1hdChsb2NhbGVzLCBvcHRpb25zKTtcclxuICAgICAgICAgICAgY29uc3QgZm9ybWF0dGVyV2l0aFJhbmdlID0gZm9ybWF0dGVyIGFzIGFueTtcclxuXHJcbiAgICAgICAgICAgIGlmICh0eXBlb2YgZm9ybWF0dGVyV2l0aFJhbmdlLmZvcm1hdFJhbmdlID09PSAnZnVuY3Rpb24nKSB7XHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKHN0YXJ0T2ZEYXkoYWRkRGF5cyhzdGFydCwgMSkpLmdldFRpbWUoKSA9PT0gZW5kLmdldFRpbWUoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGVuZCA9IGFkZERheXMoZW5kLCAtMSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZvcm1hdHRlcldpdGhSYW5nZS5mb3JtYXRSYW5nZShzdGFydCwgZW5kKTtcclxuICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBgJHtmb3JtYXR0ZXIuZm9ybWF0KHN0YXJ0KX0gLSAke2Zvcm1hdHRlci5mb3JtYXQoZW5kKX1gO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgcmV0dXJuICcnO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4iXX0=
|
|
@@ -2,6 +2,7 @@ export * from './date-pipes.module';
|
|
|
2
2
|
export * from './date-period-format.pipe';
|
|
3
3
|
export * from './date-format.pipe';
|
|
4
4
|
export * from './date-time-range-format.pipe';
|
|
5
|
+
export * from './date-time-range-duration.pipe';
|
|
5
6
|
export * from './date-time-formats.constants';
|
|
6
7
|
export * from './date-compare.pipe';
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL25neC1zZHMtY29tcG9uZW50cy9zcmMvbGliL2RhdGUtcGlwZXMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHFCQUFxQixDQUFDO0FBQ3BDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLCtCQUErQixDQUFDO0FBQzlDLGNBQWMsaUNBQWlDLENBQUM7QUFDaEQsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLHFCQUFxQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9kYXRlLXBpcGVzLm1vZHVsZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vZGF0ZS1wZXJpb2QtZm9ybWF0LnBpcGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2RhdGUtZm9ybWF0LnBpcGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2RhdGUtdGltZS1yYW5nZS1mb3JtYXQucGlwZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vZGF0ZS10aW1lLXJhbmdlLWR1cmF0aW9uLnBpcGUnO1xyXG5leHBvcnQgKiBmcm9tICcuL2RhdGUtdGltZS1mb3JtYXRzLmNvbnN0YW50cyc7XHJcbmV4cG9ydCAqIGZyb20gJy4vZGF0ZS1jb21wYXJlLnBpcGUnOyJdfQ==
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Pipe, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { isSameDay, isSameYear } from 'date-fns';
|
|
4
|
+
import { isSameDay, isSameYear, startOfDay, addDays } from 'date-fns';
|
|
5
|
+
import differenceInMinutes from 'date-fns/differenceInMinutes';
|
|
5
6
|
|
|
6
7
|
class SdsDatePeriodFormatPipe {
|
|
7
8
|
transform(from, to, locales, options, omitRedundantSegments = false, periodSeparator = '-', omitCurrentYear = false) {
|
|
@@ -130,13 +131,16 @@ class DateTimeRangeFormatPipe {
|
|
|
130
131
|
}
|
|
131
132
|
try {
|
|
132
133
|
const start = new Date(startDate);
|
|
133
|
-
|
|
134
|
+
let end = new Date(endDate);
|
|
134
135
|
if (!options || isNaN(start.getTime()) || isNaN(end.getTime())) {
|
|
135
136
|
return '';
|
|
136
137
|
}
|
|
137
138
|
const formatter = new Intl.DateTimeFormat(locales, options);
|
|
138
139
|
const formatterWithRange = formatter;
|
|
139
140
|
if (typeof formatterWithRange.formatRange === 'function') {
|
|
141
|
+
if (startOfDay(addDays(start, 1)).getTime() === end.getTime()) {
|
|
142
|
+
end = addDays(end, -1);
|
|
143
|
+
}
|
|
140
144
|
return formatterWithRange.formatRange(start, end);
|
|
141
145
|
}
|
|
142
146
|
else {
|
|
@@ -186,11 +190,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
186
190
|
}]
|
|
187
191
|
}] });
|
|
188
192
|
|
|
193
|
+
class SdsDateTimeRangeDurationPipe {
|
|
194
|
+
transform(startDate, endDate) {
|
|
195
|
+
if (!startDate || !endDate) {
|
|
196
|
+
return '';
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const start = new Date(startDate);
|
|
200
|
+
const end = new Date(endDate);
|
|
201
|
+
// const formatter = new Intl.DurationFormat(locales, options);
|
|
202
|
+
const totalMinutes = differenceInMinutes(end, start);
|
|
203
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
204
|
+
const minutes = totalMinutes % 60;
|
|
205
|
+
return `${hours}:${minutes.toString().padStart(2, '0')}`;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
return '';
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
SdsDateTimeRangeDurationPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
213
|
+
SdsDateTimeRangeDurationPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, name: "sdsDateTimeRangeDuration" });
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, decorators: [{
|
|
215
|
+
type: Pipe,
|
|
216
|
+
args: [{
|
|
217
|
+
name: 'sdsDateTimeRangeDuration',
|
|
218
|
+
}]
|
|
219
|
+
}] });
|
|
220
|
+
|
|
189
221
|
const pipes = [
|
|
190
222
|
SdsDatePeriodFormatPipe,
|
|
191
223
|
SdsDateFormatPipe,
|
|
192
224
|
DateTimeRangeFormatPipe,
|
|
193
|
-
SdsDateComparePipe
|
|
225
|
+
SdsDateComparePipe,
|
|
226
|
+
SdsDateTimeRangeDurationPipe
|
|
194
227
|
];
|
|
195
228
|
class SdsDatePipesModule {
|
|
196
229
|
}
|
|
@@ -198,10 +231,12 @@ SdsDatePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versi
|
|
|
198
231
|
SdsDatePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, declarations: [SdsDatePeriodFormatPipe,
|
|
199
232
|
SdsDateFormatPipe,
|
|
200
233
|
DateTimeRangeFormatPipe,
|
|
201
|
-
SdsDateComparePipe
|
|
234
|
+
SdsDateComparePipe,
|
|
235
|
+
SdsDateTimeRangeDurationPipe], imports: [CommonModule], exports: [SdsDatePeriodFormatPipe,
|
|
202
236
|
SdsDateFormatPipe,
|
|
203
237
|
DateTimeRangeFormatPipe,
|
|
204
|
-
SdsDateComparePipe
|
|
238
|
+
SdsDateComparePipe,
|
|
239
|
+
SdsDateTimeRangeDurationPipe] });
|
|
205
240
|
SdsDatePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, imports: [CommonModule] });
|
|
206
241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, decorators: [{
|
|
207
242
|
type: NgModule,
|
|
@@ -372,5 +407,5 @@ const DATE_TIME_FORMAT_OPTIONS = {
|
|
|
372
407
|
* Generated bundle index. Do not edit.
|
|
373
408
|
*/
|
|
374
409
|
|
|
375
|
-
export { DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS, DATE_LONG_MONTH_OPTIONS, DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS, DATE_NUMERIC_MONTH_OPTIONS, DATE_SHORT_MONTH_OPTIONS, DATE_TIME_FORMAT_OPTIONS, DateTimeRangeFormatPipe, SdsDateComparePipe, SdsDateFormatPipe, SdsDatePeriodFormatPipe, SdsDatePipesModule, TIME_HOUR_2DIGIT_OPTION, TIME_HOUR_NUMERIC_OPTION, TIME_HOUR_NUMERIC_SECONDS_OPTION };
|
|
410
|
+
export { DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS, DATE_LONG_MONTH_OPTIONS, DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS, DATE_NUMERIC_MONTH_OPTIONS, DATE_SHORT_MONTH_OPTIONS, DATE_TIME_FORMAT_OPTIONS, DateTimeRangeFormatPipe, SdsDateComparePipe, SdsDateFormatPipe, SdsDatePeriodFormatPipe, SdsDatePipesModule, SdsDateTimeRangeDurationPipe, TIME_HOUR_2DIGIT_OPTION, TIME_HOUR_NUMERIC_OPTION, TIME_HOUR_NUMERIC_SECONDS_OPTION };
|
|
376
411
|
//# sourceMappingURL=spicainternational-ngx-sds-components-src-lib-date-pipes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-date-pipes.mjs","sources":["../../../projects/ngx-sds-components/src/lib/date-pipes/date-period-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-range-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-compare.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-pipes.module.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-formats.constants.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/spicainternational-ngx-sds-components-src-lib-date-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\nimport { isSameDay, isSameYear } from 'date-fns';\r\n\r\n@Pipe({\r\n name: 'sdsDatePeriodFormat',\r\n})\r\nexport class SdsDatePeriodFormatPipe implements PipeTransform {\r\n transform(\r\n from: Date,\r\n to: Date,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions,\r\n omitRedundantSegments: boolean = false,\r\n periodSeparator: string = '-',\r\n omitCurrentYear: boolean = false\r\n ): string {\r\n if (!from) {\r\n return '';\r\n }\r\n\r\n if (!to) {\r\n return from.toLocaleDateString(locales, options);\r\n }\r\n\r\n\r\n if (isSameDay(from, to)) {\r\n return from.toLocaleDateString(locales, options);\r\n } else {\r\n let fromOptions = {...options};\r\n let toOptions = {...options};\r\n\r\n if (omitRedundantSegments && fromOptions && toOptions) {\r\n\r\n // if both dates are in current year -> remove it from format\r\n const now = new Date();\r\n if (omitCurrentYear && isSameYear(from, now) && isSameYear(to, now)) {\r\n fromOptions.year = undefined;\r\n toOptions.year = undefined;\r\n } \r\n\r\n if (isSameYear(from, to)) {\r\n // if both dates have same year -> remove it from start data\r\n fromOptions.year = undefined;\r\n }\r\n }\r\n\r\n const fromString = from.toLocaleDateString(locales, fromOptions);\r\n const toString = to.toLocaleDateString(locales, toOptions);\r\n\r\n return `${fromString} ${periodSeparator} ${toString}`;\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateFormat',\r\n})\r\nexport class SdsDateFormatPipe implements PipeTransform {\r\n\r\n /**\r\n * Formats date in given locale.\r\n *\r\n * @param date Date to be formatted.\r\n * @param locale A locale code for the locale format rules to use.\r\n * @param options An optional Intl.DateTimeFormatOptions parameter that can be used to fine-tune the output.\r\n * @returns A string with formatted date\r\n * @see [Intl docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)\r\n *\r\n * @publicApi\r\n */\r\n public transform(\r\n date: Date | number | string | undefined,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions | 'time' | 'date' | 'date-medium' | 'date-long' | 'date-time'\r\n ): string {\r\n if (date === null || date === undefined) {\r\n return ''\r\n }\r\n\r\n const formatDate = new Date(date);\r\n if (formatDate.toString() == 'Invalid Date') {\r\n return ''\r\n } \r\n\r\n if (options === 'time'){\r\n return formatDate.toLocaleTimeString(locales, {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else if (options === 'date'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: 'numeric', \r\n month: 'numeric', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-medium'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: '2-digit', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-long'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: 'short', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-time'){\r\n return formatDate.toLocaleDateString(locales, {\r\n weekday: 'short', \r\n day: 'numeric', \r\n month: 'short', \r\n year:'numeric', \r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else {\r\n return formatDate.toLocaleDateString(locales, options as Intl.DateTimeFormatOptions | undefined);\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateTimeRangeFormat',\r\n})\r\nexport class DateTimeRangeFormatPipe implements PipeTransform {\r\n /**\r\n * Formats a date range using Intl.DateTimeFormat.formatRange\r\n * @param startDate - The start date of the range\r\n * @param endDate - The end date of the range\r\n * @param locales - Locale(s) to use for formatting (optional, defaults to browser locale)\r\n * @param options - Intl.DateTimeFormatOptions for customizing the format\r\n * @returns Formatted date range string\r\n */\r\n transform(\r\n startDate: Date | string | number,\r\n endDate: Date | string | number,\r\n locales: string | string[],\r\n options: Intl.DateTimeFormatOptions\r\n ): string {\r\n if (!startDate || !endDate) {\r\n return '';\r\n }\r\n\r\n try {\r\n const start = new Date(startDate);\r\n const end = new Date(endDate);\r\n\r\n if (!options || isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n return '';\r\n }\r\n\r\n const formatter = new Intl.DateTimeFormat(locales, options);\r\n const formatterWithRange = formatter as any;\r\n\r\n if (typeof formatterWithRange.formatRange === 'function') {\r\n return formatterWithRange.formatRange(start, end);\r\n } else {\r\n return `${formatter.format(start)} - ${formatter.format(end)}`;\r\n }\r\n } catch (error) {\r\n return '';\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateCompare',\r\n})\r\nexport class SdsDateComparePipe implements PipeTransform {\r\n transform(\r\n date1: Date | string | number,\r\n date2: Date | string | number,\r\n operator: 'gt' | 'lt' | 'eq' | 'gte' | 'lte'\r\n ): boolean {\r\n const d1 = new Date(date1);\r\n const d2 = new Date(date2);\r\n\r\n switch (operator) {\r\n case 'gt':\r\n return d1 > d2;\r\n case 'lt':\r\n return d1 < d2;\r\n case 'eq':\r\n return d1.getTime() === d2.getTime();\r\n case 'gte':\r\n return d1 >= d2;\r\n case 'lte':\r\n return d1 <= d2;\r\n default:\r\n return false;\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsDatePeriodFormatPipe } from './date-period-format.pipe';\r\nimport { SdsDateFormatPipe } from './date-format.pipe';\r\nimport { DateTimeRangeFormatPipe } from './date-time-range-format.pipe';\r\nimport { SdsDateComparePipe } from './date-compare.pipe';\r\n\r\n\r\nconst pipes = [\r\n SdsDatePeriodFormatPipe, \r\n SdsDateFormatPipe, \r\n DateTimeRangeFormatPipe,\r\n SdsDateComparePipe\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...pipes\r\n ],\r\n imports: [\r\n CommonModule,\r\n ],\r\n exports:[\r\n ...pipes\r\n ]\r\n})\r\nexport class SdsDatePipesModule { }\r\n","/**\r\n * Common Intl.DateTimeFormatOptions constants for consistent date/time formatting\r\n */\r\n\r\n// Date formats\r\nexport const DATE_NUMERIC_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'numeric',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_SHORT_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'short',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'long',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'long',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\nexport const DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'short',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\n\r\n// export const SHORT_DATE_WITH_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// // Long date formats\r\n// export const LONG_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric'\r\n// };\r\n\r\n\r\n\r\n\r\n\r\n// Time formats\r\nexport const TIME_HOUR_NUMERIC_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_2DIGIT_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: '2-digit',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_NUMERIC_SECONDS_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n second: '2-digit'\r\n};\r\n\r\n// export const TIME_24H_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// export const TIME_WITH_SECONDS_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// second: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Date and time combinations\r\n// export const SHORT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const LONG_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const COMPACT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: '2-digit',\r\n// day: '2-digit',\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Time range specific formats (optimized for ranges)\r\n\r\n\r\n// export const TIME_RANGE_WITH_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const DATE_RANGE_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const DATE_RANGE_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// Special formats\r\n// export const RELATIVE_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const MONTH_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// export const WEEKDAY_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long'\r\n// };\r\n\r\n// export const YEAR_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric'\r\n// };\r\n\r\n// Utility object for easy access\r\nexport const DATE_TIME_FORMAT_OPTIONS = {\r\n\r\n DATE_NUMERIC_MONTH: DATE_NUMERIC_MONTH_OPTIONS,\r\n DATE_SHORT_MONTH: DATE_SHORT_MONTH_OPTIONS,\r\n DATE_LONG_MONTH: DATE_LONG_MONTH_OPTIONS,\r\n\r\n DATE_LONG_MONTH_LONG_WEEKDAY: DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS,\r\n DATE_LONG_MONTH_SHORT_WEEKDAY: DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS,\r\n\r\n TIME_HOUR_NUMERIC: TIME_HOUR_NUMERIC_OPTION,\r\n TIME_HOUR_2DIGIT: TIME_HOUR_2DIGIT_OPTION,\r\n TIME_HOUR_NUMERIC_SECONDS: TIME_HOUR_NUMERIC_SECONDS_OPTION,\r\n\r\n // SHORT_DATE_WITH_WEEKDAY: SHORT_DATE_WITH_WEEKDAY_OPTIONS,\r\n \r\n // Long formats\r\n// LONG_DATE_WITH_WEEKDAY: LONG_DATE_WITH_WEEKDAY_OPTIONS,\r\n\r\n // Time formats\r\n// TIME_12H: TIME_12H_OPTIONS,\r\n// TIME_24H: TIME_24H_OPTIONS,\r\n// TIME_WITH_SECONDS: TIME_WITH_SECONDS_OPTIONS,\r\n \r\n // DateTime combinations\r\n// SHORT_DATETIME: SHORT_DATETIME_OPTIONS,\r\n// LONG_DATETIME: LONG_DATETIME_OPTIONS,\r\n// COMPACT_DATETIME: COMPACT_DATETIME_OPTIONS,\r\n \r\n // Range specific\r\n \r\n// TIME_RANGE_WITH_DATE: TIME_RANGE_WITH_DATE_OPTIONS,\r\n// DATE_RANGE_MONTH: DATE_RANGE_MONTH_OPTIONS,\r\n// DATE_RANGE_YEAR: DATE_RANGE_YEAR_OPTIONS,\r\n \r\n // Special\r\n// RELATIVE_DATE: RELATIVE_DATE_OPTIONS,\r\n// MONTH_YEAR: MONTH_YEAR_OPTIONS,\r\n// WEEKDAY_ONLY: WEEKDAY_ONLY_OPTIONS,\r\n// YEAR_ONLY: YEAR_ONLY_OPTIONS\r\n} as const;\r\nexport type DateTimeFormatOptionKeys = keyof typeof DATE_TIME_FORMAT_OPTIONS;\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAMa,uBAAuB,CAAA;AAChC,IAAA,SAAS,CACL,IAAU,EACV,EAAQ,EACR,OAA+B,EAC/B,OAAoC,EACpC,qBAAA,GAAiC,KAAK,EACtC,eAAA,GAA0B,GAAG,EAC7B,kBAA2B,KAAK,EAAA;QAEhC,IAAI,CAAC,IAAI,EAAE;AACP,YAAA,OAAO,EAAE,CAAC;AACb,SAAA;QAED,IAAI,CAAC,EAAE,EAAE;YACL,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,SAAA;AAGD,QAAA,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,SAAA;AAAM,aAAA;AACH,YAAA,IAAI,WAAW,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAO,OAAO,CAAC,CAAC;AAC/B,YAAA,IAAI,SAAS,GAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAO,OAAO,CAAC,CAAC;AAE7B,YAAA,IAAI,qBAAqB,IAAI,WAAW,IAAI,SAAS,EAAE;;AAGnD,gBAAA,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;AACvB,gBAAA,IAAI,eAAe,IAAI,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,UAAU,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE;AACjE,oBAAA,WAAW,CAAC,IAAI,GAAG,SAAS,CAAC;AAC7B,oBAAA,SAAS,CAAC,IAAI,GAA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IAAA,kBAAkB,EAAE,0BAA0B;AAC9C,IAAA,gBAAgB,EAAE,wBAAwB;AAC1C,IAAA,eAAe,EAAE,uBAAuB;AAExC,IAAA,4BAA4B,EAAE,oCAAoC;AAClE,IAAA,6BAA6B,EAAE,qCAAqC;AAEpE,IAAA,iBAAiB,EAAE,wBAAwB;AAC3C,IAAA,gBAAgB,EAAE,uBAAuB;AACzC,IAAA,yBAAyB,EAAE,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;ACtK/D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-date-pipes.mjs","sources":["../../../projects/ngx-sds-components/src/lib/date-pipes/date-period-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-range-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-compare.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-range-duration.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-pipes.module.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-formats.constants.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/spicainternational-ngx-sds-components-src-lib-date-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\nimport { isSameDay, isSameYear } from 'date-fns';\r\n\r\n@Pipe({\r\n name: 'sdsDatePeriodFormat',\r\n})\r\nexport class SdsDatePeriodFormatPipe implements PipeTransform {\r\n transform(\r\n from: Date,\r\n to: Date,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions,\r\n omitRedundantSegments: boolean = false,\r\n periodSeparator: string = '-',\r\n omitCurrentYear: boolean = false\r\n ): string {\r\n if (!from) {\r\n return '';\r\n }\r\n\r\n if (!to) {\r\n return from.toLocaleDateString(locales, options);\r\n }\r\n\r\n\r\n if (isSameDay(from, to)) {\r\n return from.toLocaleDateString(locales, options);\r\n } else {\r\n let fromOptions = {...options};\r\n let toOptions = {...options};\r\n\r\n if (omitRedundantSegments && fromOptions && toOptions) {\r\n\r\n // if both dates are in current year -> remove it from format\r\n const now = new Date();\r\n if (omitCurrentYear && isSameYear(from, now) && isSameYear(to, now)) {\r\n fromOptions.year = undefined;\r\n toOptions.year = undefined;\r\n } \r\n\r\n if (isSameYear(from, to)) {\r\n // if both dates have same year -> remove it from start data\r\n fromOptions.year = undefined;\r\n }\r\n }\r\n\r\n const fromString = from.toLocaleDateString(locales, fromOptions);\r\n const toString = to.toLocaleDateString(locales, toOptions);\r\n\r\n return `${fromString} ${periodSeparator} ${toString}`;\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateFormat',\r\n})\r\nexport class SdsDateFormatPipe implements PipeTransform {\r\n\r\n /**\r\n * Formats date in given locale.\r\n *\r\n * @param date Date to be formatted.\r\n * @param locale A locale code for the locale format rules to use.\r\n * @param options An optional Intl.DateTimeFormatOptions parameter that can be used to fine-tune the output.\r\n * @returns A string with formatted date\r\n * @see [Intl docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)\r\n *\r\n * @publicApi\r\n */\r\n public transform(\r\n date: Date | number | string | undefined,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions | 'time' | 'date' | 'date-medium' | 'date-long' | 'date-time'\r\n ): string {\r\n if (date === null || date === undefined) {\r\n return ''\r\n }\r\n\r\n const formatDate = new Date(date);\r\n if (formatDate.toString() == 'Invalid Date') {\r\n return ''\r\n } \r\n\r\n if (options === 'time'){\r\n return formatDate.toLocaleTimeString(locales, {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else if (options === 'date'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: 'numeric', \r\n month: 'numeric', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-medium'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: '2-digit', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-long'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: 'short', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-time'){\r\n return formatDate.toLocaleDateString(locales, {\r\n weekday: 'short', \r\n day: 'numeric', \r\n month: 'short', \r\n year:'numeric', \r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else {\r\n return formatDate.toLocaleDateString(locales, options as Intl.DateTimeFormatOptions | undefined);\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport { addDays, startOfDay } from 'date-fns';\r\n\r\n@Pipe({\r\n name: 'sdsDateTimeRangeFormat',\r\n})\r\nexport class DateTimeRangeFormatPipe implements PipeTransform {\r\n /**\r\n * Formats a date range using Intl.DateTimeFormat.formatRange\r\n * @param startDate - The start date of the range\r\n * @param endDate - The end date of the range\r\n * @param locales - Locale(s) to use for formatting (optional, defaults to browser locale)\r\n * @param options - Intl.DateTimeFormatOptions for customizing the format\r\n * @returns Formatted date range string\r\n */\r\n transform(\r\n startDate: Date | string | number,\r\n endDate: Date | string | number,\r\n locales: string | string[],\r\n options: Intl.DateTimeFormatOptions\r\n ): string {\r\n if (!startDate || !endDate) {\r\n return '';\r\n }\r\n\r\n try {\r\n const start = new Date(startDate);\r\n let end = new Date(endDate);\r\n\r\n if (!options || isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n return '';\r\n }\r\n\r\n const formatter = new Intl.DateTimeFormat(locales, options);\r\n const formatterWithRange = formatter as any;\r\n\r\n if (typeof formatterWithRange.formatRange === 'function') {\r\n\r\n if (startOfDay(addDays(start, 1)).getTime() === end.getTime()) {\r\n end = addDays(end, -1);\r\n }\r\n\r\n return formatterWithRange.formatRange(start, end);\r\n } else {\r\n return `${formatter.format(start)} - ${formatter.format(end)}`;\r\n }\r\n } catch (error) {\r\n return '';\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateCompare',\r\n})\r\nexport class SdsDateComparePipe implements PipeTransform {\r\n transform(\r\n date1: Date | string | number,\r\n date2: Date | string | number,\r\n operator: 'gt' | 'lt' | 'eq' | 'gte' | 'lte'\r\n ): boolean {\r\n const d1 = new Date(date1);\r\n const d2 = new Date(date2);\r\n\r\n switch (operator) {\r\n case 'gt':\r\n return d1 > d2;\r\n case 'lt':\r\n return d1 < d2;\r\n case 'eq':\r\n return d1.getTime() === d2.getTime();\r\n case 'gte':\r\n return d1 >= d2;\r\n case 'lte':\r\n return d1 <= d2;\r\n default:\r\n return false;\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport differenceInMinutes from 'date-fns/differenceInMinutes';\r\n\r\n@Pipe({\r\n name: 'sdsDateTimeRangeDuration',\r\n})\r\nexport class SdsDateTimeRangeDurationPipe implements PipeTransform {\r\n transform(\r\n startDate: Date | string | number,\r\n endDate: Date | string | number,\r\n //locales: string | string[],\r\n \r\n ): string {\r\n\r\n if (!startDate || !endDate) {\r\n return '';\r\n }\r\n\r\n try {\r\n const start = new Date(startDate);\r\n const end = new Date(endDate); \r\n \r\n // const formatter = new Intl.DurationFormat(locales, options);\r\n\r\n const totalMinutes = differenceInMinutes(end, start);\r\n const hours = Math.floor(totalMinutes / 60);\r\n const minutes = totalMinutes % 60;\r\n\r\n return `${hours}:${minutes.toString().padStart(2, '0')}`;\r\n } catch (error) {\r\n return '';\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsDatePeriodFormatPipe } from './date-period-format.pipe';\r\nimport { SdsDateFormatPipe } from './date-format.pipe';\r\nimport { DateTimeRangeFormatPipe } from './date-time-range-format.pipe';\r\nimport { SdsDateComparePipe } from './date-compare.pipe';\r\nimport { SdsDateTimeRangeDurationPipe } from './date-time-range-duration.pipe';\r\n\r\n\r\nconst pipes = [\r\n SdsDatePeriodFormatPipe, \r\n SdsDateFormatPipe, \r\n DateTimeRangeFormatPipe,\r\n SdsDateComparePipe,\r\n SdsDateTimeRangeDurationPipe\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...pipes\r\n ],\r\n imports: [\r\n CommonModule,\r\n ],\r\n exports:[\r\n ...pipes\r\n ]\r\n})\r\nexport class SdsDatePipesModule { }\r\n","/**\r\n * Common Intl.DateTimeFormatOptions constants for consistent date/time formatting\r\n */\r\n\r\n// Date formats\r\nexport const DATE_NUMERIC_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'numeric',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_SHORT_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'short',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'long',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'long',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\nexport const DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'short',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\n\r\n// export const SHORT_DATE_WITH_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// // Long date formats\r\n// export const LONG_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric'\r\n// };\r\n\r\n\r\n\r\n\r\n\r\n// Time formats\r\nexport const TIME_HOUR_NUMERIC_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_2DIGIT_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: '2-digit',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_NUMERIC_SECONDS_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n second: '2-digit'\r\n};\r\n\r\n// export const TIME_24H_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// export const TIME_WITH_SECONDS_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// second: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Date and time combinations\r\n// export const SHORT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const LONG_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const COMPACT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: '2-digit',\r\n// day: '2-digit',\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Time range specific formats (optimized for ranges)\r\n\r\n\r\n// export const TIME_RANGE_WITH_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const DATE_RANGE_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const DATE_RANGE_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// Special formats\r\n// export const RELATIVE_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const MONTH_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// export const WEEKDAY_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long'\r\n// };\r\n\r\n// export const YEAR_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric'\r\n// };\r\n\r\n// Utility object for easy access\r\nexport const DATE_TIME_FORMAT_OPTIONS = {\r\n\r\n DATE_NUMERIC_MONTH: DATE_NUMERIC_MONTH_OPTIONS,\r\n DATE_SHORT_MONTH: DATE_SHORT_MONTH_OPTIONS,\r\n DATE_LONG_MONTH: DATE_LONG_MONTH_OPTIONS,\r\n\r\n DATE_LONG_MONTH_LONG_WEEKDAY: DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS,\r\n DATE_LONG_MONTH_SHORT_WEEKDAY: DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS,\r\n\r\n TIME_HOUR_NUMERIC: TIME_HOUR_NUMERIC_OPTION,\r\n TIME_HOUR_2DIGIT: TIME_HOUR_2DIGIT_OPTION,\r\n TIME_HOUR_NUMERIC_SECONDS: TIME_HOUR_NUMERIC_SECONDS_OPTION,\r\n\r\n // SHORT_DATE_WITH_WEEKDAY: SHORT_DATE_WITH_WEEKDAY_OPTIONS,\r\n \r\n // Long formats\r\n// LONG_DATE_WITH_WEEKDAY: LONG_DATE_WITH_WEEKDAY_OPTIONS,\r\n\r\n // Time formats\r\n// TIME_12H: TIME_12H_OPTIONS,\r\n// TIME_24H: TIME_24H_OPTIONS,\r\n// TIME_WITH_SECONDS: TIME_WITH_SECONDS_OPTIONS,\r\n \r\n // DateTime combinations\r\n// SHORT_DATETIME: SHORT_DATETIME_OPTIONS,\r\n// LONG_DATETIME: LONG_DATETIME_OPTIONS,\r\n// COMPACT_DATETIME: COMPACT_DATETIME_OPTIONS,\r\n \r\n // Range specific\r\n \r\n// TIME_RANGE_WITH_DATE: TIME_RANGE_WITH_DATE_OPTIONS,\r\n// DATE_RANGE_MONTH: DATE_RANGE_MONTH_OPTIONS,\r\n// DATE_RANGE_YEAR: DATE_RANGE_YEAR_OPTIONS,\r\n \r\n // Special\r\n// RELATIVE_DATE: RELATIVE_DATE_OPTIONS,\r\n// MONTH_YEAR: MONTH_YEAR_OPTIONS,\r\n// WEEKDAY_ONLY: WEEKDAY_ONLY_OPTIONS,\r\n// YEAR_ONLY: YEAR_ONLY_OPTIONS\r\n} as const;\r\nexport type DateTimeFormatOptionKeys = keyof typeof DATE_TIME_FORMAT_OPTIONS;\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,uBAAuB,CAAA;AAChC,IAAA,SAAS,CACL,IAAU,EACV,EAAQ,EACR,OAA+B,EAC/B,OAAoC,EACpC,qBAAA,GAAiC,KAAK,EACtC,eAAA,GAA0B,GAAG,EAC7B,kBAA2B,KAAK,EAAA;QAEhC,IAAI,CAAC,IAAI,EAAE;AACP,YAAA,OAAO,EAAE,CAAC;AACb,SAAA;QAED,IAAI,CAAC,EAAE,EAAE;YACL,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,SAAA;AAGD,QAAA,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,SAAA;AAAM,aAAA;AACH,YAAA,IAAI,WAAW,G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EACjB;AAEW,MAAA,gCAAgC,GAA+B;AAC1E,IAAA,IAAI,EAAE,SAAS;AACf,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,SAAS;EACjB;AAEF;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACa,MAAA,wBAAwB,GAAG;AAEpC,IAAA,kBAAkB,EAAE,0BAA0B;AAC9C,IAAA,gBAAgB,EAAE,wBAAwB;AAC1C,IAAA,eAAe,EAAE,uBAAuB;AAExC,IAAA,4BAA4B,EAAE,oCAAoC;AAClE,IAAA,6BAA6B,EAAE,qCAAqC;AAEpE,IAAA,iBAAiB,EAAE,wBAAwB;AAC3C,IAAA,gBAAgB,EAAE,uBAAuB;AACzC,IAAA,yBAAyB,EAAE,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;ACtK/D;;AAEG;;;;"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Pipe, NgModule } from '@angular/core';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { isSameDay, isSameYear } from 'date-fns';
|
|
4
|
+
import { isSameDay, isSameYear, startOfDay, addDays } from 'date-fns';
|
|
5
|
+
import differenceInMinutes from 'date-fns/differenceInMinutes';
|
|
5
6
|
|
|
6
7
|
class SdsDatePeriodFormatPipe {
|
|
7
8
|
transform(from, to, locales, options, omitRedundantSegments = false, periodSeparator = '-', omitCurrentYear = false) {
|
|
@@ -130,13 +131,16 @@ class DateTimeRangeFormatPipe {
|
|
|
130
131
|
}
|
|
131
132
|
try {
|
|
132
133
|
const start = new Date(startDate);
|
|
133
|
-
|
|
134
|
+
let end = new Date(endDate);
|
|
134
135
|
if (!options || isNaN(start.getTime()) || isNaN(end.getTime())) {
|
|
135
136
|
return '';
|
|
136
137
|
}
|
|
137
138
|
const formatter = new Intl.DateTimeFormat(locales, options);
|
|
138
139
|
const formatterWithRange = formatter;
|
|
139
140
|
if (typeof formatterWithRange.formatRange === 'function') {
|
|
141
|
+
if (startOfDay(addDays(start, 1)).getTime() === end.getTime()) {
|
|
142
|
+
end = addDays(end, -1);
|
|
143
|
+
}
|
|
140
144
|
return formatterWithRange.formatRange(start, end);
|
|
141
145
|
}
|
|
142
146
|
else {
|
|
@@ -186,11 +190,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
186
190
|
}]
|
|
187
191
|
}] });
|
|
188
192
|
|
|
193
|
+
class SdsDateTimeRangeDurationPipe {
|
|
194
|
+
transform(startDate, endDate) {
|
|
195
|
+
if (!startDate || !endDate) {
|
|
196
|
+
return '';
|
|
197
|
+
}
|
|
198
|
+
try {
|
|
199
|
+
const start = new Date(startDate);
|
|
200
|
+
const end = new Date(endDate);
|
|
201
|
+
// const formatter = new Intl.DurationFormat(locales, options);
|
|
202
|
+
const totalMinutes = differenceInMinutes(end, start);
|
|
203
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
204
|
+
const minutes = totalMinutes % 60;
|
|
205
|
+
return `${hours}:${minutes.toString().padStart(2, '0')}`;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
return '';
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
SdsDateTimeRangeDurationPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
213
|
+
SdsDateTimeRangeDurationPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, name: "sdsDateTimeRangeDuration" });
|
|
214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDateTimeRangeDurationPipe, decorators: [{
|
|
215
|
+
type: Pipe,
|
|
216
|
+
args: [{
|
|
217
|
+
name: 'sdsDateTimeRangeDuration',
|
|
218
|
+
}]
|
|
219
|
+
}] });
|
|
220
|
+
|
|
189
221
|
const pipes = [
|
|
190
222
|
SdsDatePeriodFormatPipe,
|
|
191
223
|
SdsDateFormatPipe,
|
|
192
224
|
DateTimeRangeFormatPipe,
|
|
193
|
-
SdsDateComparePipe
|
|
225
|
+
SdsDateComparePipe,
|
|
226
|
+
SdsDateTimeRangeDurationPipe
|
|
194
227
|
];
|
|
195
228
|
class SdsDatePipesModule {
|
|
196
229
|
}
|
|
@@ -198,10 +231,12 @@ SdsDatePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", versi
|
|
|
198
231
|
SdsDatePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, declarations: [SdsDatePeriodFormatPipe,
|
|
199
232
|
SdsDateFormatPipe,
|
|
200
233
|
DateTimeRangeFormatPipe,
|
|
201
|
-
SdsDateComparePipe
|
|
234
|
+
SdsDateComparePipe,
|
|
235
|
+
SdsDateTimeRangeDurationPipe], imports: [CommonModule], exports: [SdsDatePeriodFormatPipe,
|
|
202
236
|
SdsDateFormatPipe,
|
|
203
237
|
DateTimeRangeFormatPipe,
|
|
204
|
-
SdsDateComparePipe
|
|
238
|
+
SdsDateComparePipe,
|
|
239
|
+
SdsDateTimeRangeDurationPipe] });
|
|
205
240
|
SdsDatePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, imports: [CommonModule] });
|
|
206
241
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: SdsDatePipesModule, decorators: [{
|
|
207
242
|
type: NgModule,
|
|
@@ -378,5 +413,5 @@ const DATE_TIME_FORMAT_OPTIONS = {
|
|
|
378
413
|
* Generated bundle index. Do not edit.
|
|
379
414
|
*/
|
|
380
415
|
|
|
381
|
-
export { DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS, DATE_LONG_MONTH_OPTIONS, DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS, DATE_NUMERIC_MONTH_OPTIONS, DATE_SHORT_MONTH_OPTIONS, DATE_TIME_FORMAT_OPTIONS, DateTimeRangeFormatPipe, SdsDateComparePipe, SdsDateFormatPipe, SdsDatePeriodFormatPipe, SdsDatePipesModule, TIME_HOUR_2DIGIT_OPTION, TIME_HOUR_NUMERIC_OPTION, TIME_HOUR_NUMERIC_SECONDS_OPTION };
|
|
416
|
+
export { DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS, DATE_LONG_MONTH_OPTIONS, DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS, DATE_NUMERIC_MONTH_OPTIONS, DATE_SHORT_MONTH_OPTIONS, DATE_TIME_FORMAT_OPTIONS, DateTimeRangeFormatPipe, SdsDateComparePipe, SdsDateFormatPipe, SdsDatePeriodFormatPipe, SdsDatePipesModule, SdsDateTimeRangeDurationPipe, TIME_HOUR_2DIGIT_OPTION, TIME_HOUR_NUMERIC_OPTION, TIME_HOUR_NUMERIC_SECONDS_OPTION };
|
|
382
417
|
//# sourceMappingURL=spicainternational-ngx-sds-components-src-lib-date-pipes.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-date-pipes.mjs","sources":["../../../projects/ngx-sds-components/src/lib/date-pipes/date-period-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-range-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-compare.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-pipes.module.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-formats.constants.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/spicainternational-ngx-sds-components-src-lib-date-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\nimport { isSameDay, isSameYear } from 'date-fns';\r\n\r\n@Pipe({\r\n name: 'sdsDatePeriodFormat',\r\n})\r\nexport class SdsDatePeriodFormatPipe implements PipeTransform {\r\n transform(\r\n from: Date,\r\n to: Date,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions,\r\n omitRedundantSegments: boolean = false,\r\n periodSeparator: string = '-',\r\n omitCurrentYear: boolean = false\r\n ): string {\r\n if (!from) {\r\n return '';\r\n }\r\n\r\n if (!to) {\r\n return from.toLocaleDateString(locales, options);\r\n }\r\n\r\n\r\n if (isSameDay(from, to)) {\r\n return from.toLocaleDateString(locales, options);\r\n } else {\r\n let fromOptions = {...options};\r\n let toOptions = {...options};\r\n\r\n if (omitRedundantSegments && fromOptions && toOptions) {\r\n\r\n // if both dates are in current year -> remove it from format\r\n const now = new Date();\r\n if (omitCurrentYear && isSameYear(from, now) && isSameYear(to, now)) {\r\n fromOptions.year = undefined;\r\n toOptions.year = undefined;\r\n } \r\n\r\n if (isSameYear(from, to)) {\r\n // if both dates have same year -> remove it from start data\r\n fromOptions.year = undefined;\r\n }\r\n }\r\n\r\n const fromString = from.toLocaleDateString(locales, fromOptions);\r\n const toString = to.toLocaleDateString(locales, toOptions);\r\n\r\n return `${fromString} ${periodSeparator} ${toString}`;\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateFormat',\r\n})\r\nexport class SdsDateFormatPipe implements PipeTransform {\r\n\r\n /**\r\n * Formats date in given locale.\r\n *\r\n * @param date Date to be formatted.\r\n * @param locale A locale code for the locale format rules to use.\r\n * @param options An optional Intl.DateTimeFormatOptions parameter that can be used to fine-tune the output.\r\n * @returns A string with formatted date\r\n * @see [Intl docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)\r\n *\r\n * @publicApi\r\n */\r\n public transform(\r\n date: Date | number | string | undefined,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions | 'time' | 'date' | 'date-medium' | 'date-long' | 'date-time'\r\n ): string {\r\n if (date === null || date === undefined) {\r\n return ''\r\n }\r\n\r\n const formatDate = new Date(date);\r\n if (formatDate.toString() == 'Invalid Date') {\r\n return ''\r\n } \r\n\r\n if (options === 'time'){\r\n return formatDate.toLocaleTimeString(locales, {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else if (options === 'date'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: 'numeric', \r\n month: 'numeric', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-medium'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: '2-digit', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-long'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: 'short', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-time'){\r\n return formatDate.toLocaleDateString(locales, {\r\n weekday: 'short', \r\n day: 'numeric', \r\n month: 'short', \r\n year:'numeric', \r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else {\r\n return formatDate.toLocaleDateString(locales, options as Intl.DateTimeFormatOptions | undefined);\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateTimeRangeFormat',\r\n})\r\nexport class DateTimeRangeFormatPipe implements PipeTransform {\r\n /**\r\n * Formats a date range using Intl.DateTimeFormat.formatRange\r\n * @param startDate - The start date of the range\r\n * @param endDate - The end date of the range\r\n * @param locales - Locale(s) to use for formatting (optional, defaults to browser locale)\r\n * @param options - Intl.DateTimeFormatOptions for customizing the format\r\n * @returns Formatted date range string\r\n */\r\n transform(\r\n startDate: Date | string | number,\r\n endDate: Date | string | number,\r\n locales: string | string[],\r\n options: Intl.DateTimeFormatOptions\r\n ): string {\r\n if (!startDate || !endDate) {\r\n return '';\r\n }\r\n\r\n try {\r\n const start = new Date(startDate);\r\n const end = new Date(endDate);\r\n\r\n if (!options || isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n return '';\r\n }\r\n\r\n const formatter = new Intl.DateTimeFormat(locales, options);\r\n const formatterWithRange = formatter as any;\r\n\r\n if (typeof formatterWithRange.formatRange === 'function') {\r\n return formatterWithRange.formatRange(start, end);\r\n } else {\r\n return `${formatter.format(start)} - ${formatter.format(end)}`;\r\n }\r\n } catch (error) {\r\n return '';\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateCompare',\r\n})\r\nexport class SdsDateComparePipe implements PipeTransform {\r\n transform(\r\n date1: Date | string | number,\r\n date2: Date | string | number,\r\n operator: 'gt' | 'lt' | 'eq' | 'gte' | 'lte'\r\n ): boolean {\r\n const d1 = new Date(date1);\r\n const d2 = new Date(date2);\r\n\r\n switch (operator) {\r\n case 'gt':\r\n return d1 > d2;\r\n case 'lt':\r\n return d1 < d2;\r\n case 'eq':\r\n return d1.getTime() === d2.getTime();\r\n case 'gte':\r\n return d1 >= d2;\r\n case 'lte':\r\n return d1 <= d2;\r\n default:\r\n return false;\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsDatePeriodFormatPipe } from './date-period-format.pipe';\r\nimport { SdsDateFormatPipe } from './date-format.pipe';\r\nimport { DateTimeRangeFormatPipe } from './date-time-range-format.pipe';\r\nimport { SdsDateComparePipe } from './date-compare.pipe';\r\n\r\n\r\nconst pipes = [\r\n SdsDatePeriodFormatPipe, \r\n SdsDateFormatPipe, \r\n DateTimeRangeFormatPipe,\r\n SdsDateComparePipe\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...pipes\r\n ],\r\n imports: [\r\n CommonModule,\r\n ],\r\n exports:[\r\n ...pipes\r\n ]\r\n})\r\nexport class SdsDatePipesModule { }\r\n","/**\r\n * Common Intl.DateTimeFormatOptions constants for consistent date/time formatting\r\n */\r\n\r\n// Date formats\r\nexport const DATE_NUMERIC_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'numeric',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_SHORT_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'short',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'long',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'long',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\nexport const DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'short',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\n\r\n// export const SHORT_DATE_WITH_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// // Long date formats\r\n// export const LONG_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric'\r\n// };\r\n\r\n\r\n\r\n\r\n\r\n// Time formats\r\nexport const TIME_HOUR_NUMERIC_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_2DIGIT_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: '2-digit',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_NUMERIC_SECONDS_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n second: '2-digit'\r\n};\r\n\r\n// export const TIME_24H_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// export const TIME_WITH_SECONDS_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// second: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Date and time combinations\r\n// export const SHORT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const LONG_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const COMPACT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: '2-digit',\r\n// day: '2-digit',\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Time range specific formats (optimized for ranges)\r\n\r\n\r\n// export const TIME_RANGE_WITH_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const DATE_RANGE_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const DATE_RANGE_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// Special formats\r\n// export const RELATIVE_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const MONTH_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// export const WEEKDAY_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long'\r\n// };\r\n\r\n// export const YEAR_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric'\r\n// };\r\n\r\n// Utility object for easy access\r\nexport const DATE_TIME_FORMAT_OPTIONS = {\r\n\r\n DATE_NUMERIC_MONTH: DATE_NUMERIC_MONTH_OPTIONS,\r\n DATE_SHORT_MONTH: DATE_SHORT_MONTH_OPTIONS,\r\n DATE_LONG_MONTH: DATE_LONG_MONTH_OPTIONS,\r\n\r\n DATE_LONG_MONTH_LONG_WEEKDAY: DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS,\r\n DATE_LONG_MONTH_SHORT_WEEKDAY: DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS,\r\n\r\n TIME_HOUR_NUMERIC: TIME_HOUR_NUMERIC_OPTION,\r\n TIME_HOUR_2DIGIT: TIME_HOUR_2DIGIT_OPTION,\r\n TIME_HOUR_NUMERIC_SECONDS: TIME_HOUR_NUMERIC_SECONDS_OPTION,\r\n\r\n // SHORT_DATE_WITH_WEEKDAY: SHORT_DATE_WITH_WEEKDAY_OPTIONS,\r\n \r\n // Long formats\r\n// LONG_DATE_WITH_WEEKDAY: LONG_DATE_WITH_WEEKDAY_OPTIONS,\r\n\r\n // Time formats\r\n// TIME_12H: TIME_12H_OPTIONS,\r\n// TIME_24H: TIME_24H_OPTIONS,\r\n// TIME_WITH_SECONDS: TIME_WITH_SECONDS_OPTIONS,\r\n \r\n // DateTime combinations\r\n// SHORT_DATETIME: SHORT_DATETIME_OPTIONS,\r\n// LONG_DATETIME: LONG_DATETIME_OPTIONS,\r\n// COMPACT_DATETIME: COMPACT_DATETIME_OPTIONS,\r\n \r\n // Range specific\r\n \r\n// TIME_RANGE_WITH_DATE: TIME_RANGE_WITH_DATE_OPTIONS,\r\n// DATE_RANGE_MONTH: DATE_RANGE_MONTH_OPTIONS,\r\n// DATE_RANGE_YEAR: DATE_RANGE_YEAR_OPTIONS,\r\n \r\n // Special\r\n// RELATIVE_DATE: RELATIVE_DATE_OPTIONS,\r\n// MONTH_YEAR: MONTH_YEAR_OPTIONS,\r\n// WEEKDAY_ONLY: WEEKDAY_ONLY_OPTIONS,\r\n// YEAR_ONLY: YEAR_ONLY_OPTIONS\r\n} as const;\r\nexport type DateTimeFormatOptionKeys = keyof typeof DATE_TIME_FORMAT_OPTIONS;\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAMa,uBAAuB,CAAA;AAChC,IAAA,SAAS,CACL,IAAU,EACV,EAAQ,EACR,OAA+B,EAC/B,OAAoC,EACpC,qBAAA,GAAiC,KAAK,EACtC,eAAA,GAA0B,GAAG,EAC7B,kBAA2B,KAAK,EAAA;QAEhC,IAAI,CAAC,IAAI,EAAE;AACP,YAAA,OAAO,EAAE,CAAC;AACb,SAAA;QAED,IAAI,CAAC,EAAE,EAAE;YACL,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,SAAA;AAGD,QAAA,IAAI,SAAS,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC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EAAE,SAAS;AACf,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,MAAM,EAAE,SAAS;EACjB;AAEF;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AAEA;AACa,MAAA,wBAAwB,GAAG;AAEpC,IAAA,kBAAkB,EAAE,0BAA0B;AAC9C,IAAA,gBAAgB,EAAE,wBAAwB;AAC1C,IAAA,eAAe,EAAE,uBAAuB;AAExC,IAAA,4BAA4B,EAAE,oCAAoC;AAClE,IAAA,6BAA6B,EAAE,qCAAqC;AAEpE,IAAA,iBAAiB,EAAE,wBAAwB;AAC3C,IAAA,gBAAgB,EAAE,uBAAuB;AACzC,IAAA,yBAAyB,EAAE,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;ACtK/D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"spicainternational-ngx-sds-components-src-lib-date-pipes.mjs","sources":["../../../projects/ngx-sds-components/src/lib/date-pipes/date-period-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-range-format.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-compare.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-range-duration.pipe.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-pipes.module.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/date-time-formats.constants.ts","../../../projects/ngx-sds-components/src/lib/date-pipes/spicainternational-ngx-sds-components-src-lib-date-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\nimport { isSameDay, isSameYear } from 'date-fns';\r\n\r\n@Pipe({\r\n name: 'sdsDatePeriodFormat',\r\n})\r\nexport class SdsDatePeriodFormatPipe implements PipeTransform {\r\n transform(\r\n from: Date,\r\n to: Date,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions,\r\n omitRedundantSegments: boolean = false,\r\n periodSeparator: string = '-',\r\n omitCurrentYear: boolean = false\r\n ): string {\r\n if (!from) {\r\n return '';\r\n }\r\n\r\n if (!to) {\r\n return from.toLocaleDateString(locales, options);\r\n }\r\n\r\n\r\n if (isSameDay(from, to)) {\r\n return from.toLocaleDateString(locales, options);\r\n } else {\r\n let fromOptions = {...options};\r\n let toOptions = {...options};\r\n\r\n if (omitRedundantSegments && fromOptions && toOptions) {\r\n\r\n // if both dates are in current year -> remove it from format\r\n const now = new Date();\r\n if (omitCurrentYear && isSameYear(from, now) && isSameYear(to, now)) {\r\n fromOptions.year = undefined;\r\n toOptions.year = undefined;\r\n } \r\n\r\n if (isSameYear(from, to)) {\r\n // if both dates have same year -> remove it from start data\r\n fromOptions.year = undefined;\r\n }\r\n }\r\n\r\n const fromString = from.toLocaleDateString(locales, fromOptions);\r\n const toString = to.toLocaleDateString(locales, toOptions);\r\n\r\n return `${fromString} ${periodSeparator} ${toString}`;\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateFormat',\r\n})\r\nexport class SdsDateFormatPipe implements PipeTransform {\r\n\r\n /**\r\n * Formats date in given locale.\r\n *\r\n * @param date Date to be formatted.\r\n * @param locale A locale code for the locale format rules to use.\r\n * @param options An optional Intl.DateTimeFormatOptions parameter that can be used to fine-tune the output.\r\n * @returns A string with formatted date\r\n * @see [Intl docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl)\r\n *\r\n * @publicApi\r\n */\r\n public transform(\r\n date: Date | number | string | undefined,\r\n locales: string | Array<string>,\r\n options?: Intl.DateTimeFormatOptions | 'time' | 'date' | 'date-medium' | 'date-long' | 'date-time'\r\n ): string {\r\n if (date === null || date === undefined) {\r\n return ''\r\n }\r\n\r\n const formatDate = new Date(date);\r\n if (formatDate.toString() == 'Invalid Date') {\r\n return ''\r\n } \r\n\r\n if (options === 'time'){\r\n return formatDate.toLocaleTimeString(locales, {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else if (options === 'date'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: 'numeric', \r\n month: 'numeric', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-medium'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: '2-digit', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-long'){\r\n return formatDate.toLocaleDateString(locales, {\r\n day: '2-digit', \r\n month: 'short', \r\n year:'numeric'\r\n }); \r\n } else if (options === 'date-time'){\r\n return formatDate.toLocaleDateString(locales, {\r\n weekday: 'short', \r\n day: 'numeric', \r\n month: 'short', \r\n year:'numeric', \r\n hour: 'numeric',\r\n minute: '2-digit'\r\n }); \r\n } else {\r\n return formatDate.toLocaleDateString(locales, options as Intl.DateTimeFormatOptions | undefined);\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport { addDays, startOfDay } from 'date-fns';\r\n\r\n@Pipe({\r\n name: 'sdsDateTimeRangeFormat',\r\n})\r\nexport class DateTimeRangeFormatPipe implements PipeTransform {\r\n /**\r\n * Formats a date range using Intl.DateTimeFormat.formatRange\r\n * @param startDate - The start date of the range\r\n * @param endDate - The end date of the range\r\n * @param locales - Locale(s) to use for formatting (optional, defaults to browser locale)\r\n * @param options - Intl.DateTimeFormatOptions for customizing the format\r\n * @returns Formatted date range string\r\n */\r\n transform(\r\n startDate: Date | string | number,\r\n endDate: Date | string | number,\r\n locales: string | string[],\r\n options: Intl.DateTimeFormatOptions\r\n ): string {\r\n if (!startDate || !endDate) {\r\n return '';\r\n }\r\n\r\n try {\r\n const start = new Date(startDate);\r\n let end = new Date(endDate);\r\n\r\n if (!options || isNaN(start.getTime()) || isNaN(end.getTime())) {\r\n return '';\r\n }\r\n\r\n const formatter = new Intl.DateTimeFormat(locales, options);\r\n const formatterWithRange = formatter as any;\r\n\r\n if (typeof formatterWithRange.formatRange === 'function') {\r\n\r\n if (startOfDay(addDays(start, 1)).getTime() === end.getTime()) {\r\n end = addDays(end, -1);\r\n }\r\n\r\n return formatterWithRange.formatRange(start, end);\r\n } else {\r\n return `${formatter.format(start)} - ${formatter.format(end)}`;\r\n }\r\n } catch (error) {\r\n return '';\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'sdsDateCompare',\r\n})\r\nexport class SdsDateComparePipe implements PipeTransform {\r\n transform(\r\n date1: Date | string | number,\r\n date2: Date | string | number,\r\n operator: 'gt' | 'lt' | 'eq' | 'gte' | 'lte'\r\n ): boolean {\r\n const d1 = new Date(date1);\r\n const d2 = new Date(date2);\r\n\r\n switch (operator) {\r\n case 'gt':\r\n return d1 > d2;\r\n case 'lt':\r\n return d1 < d2;\r\n case 'eq':\r\n return d1.getTime() === d2.getTime();\r\n case 'gte':\r\n return d1 >= d2;\r\n case 'lte':\r\n return d1 <= d2;\r\n default:\r\n return false;\r\n }\r\n }\r\n}\r\n","import { Pipe, PipeTransform } from '@angular/core';\r\nimport differenceInMinutes from 'date-fns/differenceInMinutes';\r\n\r\n@Pipe({\r\n name: 'sdsDateTimeRangeDuration',\r\n})\r\nexport class SdsDateTimeRangeDurationPipe implements PipeTransform {\r\n transform(\r\n startDate: Date | string | number,\r\n endDate: Date | string | number,\r\n //locales: string | string[],\r\n \r\n ): string {\r\n\r\n if (!startDate || !endDate) {\r\n return '';\r\n }\r\n\r\n try {\r\n const start = new Date(startDate);\r\n const end = new Date(endDate); \r\n \r\n // const formatter = new Intl.DurationFormat(locales, options);\r\n\r\n const totalMinutes = differenceInMinutes(end, start);\r\n const hours = Math.floor(totalMinutes / 60);\r\n const minutes = totalMinutes % 60;\r\n\r\n return `${hours}:${minutes.toString().padStart(2, '0')}`;\r\n } catch (error) {\r\n return '';\r\n }\r\n }\r\n}\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { SdsDatePeriodFormatPipe } from './date-period-format.pipe';\r\nimport { SdsDateFormatPipe } from './date-format.pipe';\r\nimport { DateTimeRangeFormatPipe } from './date-time-range-format.pipe';\r\nimport { SdsDateComparePipe } from './date-compare.pipe';\r\nimport { SdsDateTimeRangeDurationPipe } from './date-time-range-duration.pipe';\r\n\r\n\r\nconst pipes = [\r\n SdsDatePeriodFormatPipe, \r\n SdsDateFormatPipe, \r\n DateTimeRangeFormatPipe,\r\n SdsDateComparePipe,\r\n SdsDateTimeRangeDurationPipe\r\n];\r\n\r\n@NgModule({\r\n declarations: [\r\n ...pipes\r\n ],\r\n imports: [\r\n CommonModule,\r\n ],\r\n exports:[\r\n ...pipes\r\n ]\r\n})\r\nexport class SdsDatePipesModule { }\r\n","/**\r\n * Common Intl.DateTimeFormatOptions constants for consistent date/time formatting\r\n */\r\n\r\n// Date formats\r\nexport const DATE_NUMERIC_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'numeric',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_SHORT_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'short',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n year: 'numeric',\r\n month: 'long',\r\n day: 'numeric'\r\n};\r\n\r\nexport const DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'long',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\nexport const DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n weekday: 'short',\r\n ...DATE_LONG_MONTH_OPTIONS,\r\n};\r\n\r\n\r\n// export const SHORT_DATE_WITH_WEEKDAY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// // Long date formats\r\n// export const LONG_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric'\r\n// };\r\n\r\n\r\n\r\n\r\n\r\n// Time formats\r\nexport const TIME_HOUR_NUMERIC_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_2DIGIT_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: '2-digit',\r\n minute: '2-digit'\r\n};\r\n\r\nexport const TIME_HOUR_NUMERIC_SECONDS_OPTION: Intl.DateTimeFormatOptions = {\r\n hour: 'numeric',\r\n minute: '2-digit',\r\n second: '2-digit'\r\n};\r\n\r\n// export const TIME_24H_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// export const TIME_WITH_SECONDS_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// second: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Date and time combinations\r\n// export const SHORT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const LONG_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long',\r\n// year: 'numeric',\r\n// month: 'long',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const COMPACT_DATETIME_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: '2-digit',\r\n// day: '2-digit',\r\n// hour: '2-digit',\r\n// minute: '2-digit',\r\n// hour12: false\r\n// };\r\n\r\n// Time range specific formats (optimized for ranges)\r\n\r\n\r\n// export const TIME_RANGE_WITH_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// month: 'short',\r\n// day: 'numeric',\r\n// hour: 'numeric',\r\n// minute: '2-digit',\r\n// hour12: true\r\n// };\r\n\r\n// export const DATE_RANGE_MONTH_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const DATE_RANGE_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// Special formats\r\n// export const RELATIVE_DATE_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'short',\r\n// month: 'short',\r\n// day: 'numeric'\r\n// };\r\n\r\n// export const MONTH_YEAR_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric',\r\n// month: 'long'\r\n// };\r\n\r\n// export const WEEKDAY_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// weekday: 'long'\r\n// };\r\n\r\n// export const YEAR_ONLY_OPTIONS: Intl.DateTimeFormatOptions = {\r\n// year: 'numeric'\r\n// };\r\n\r\n// Utility object for easy access\r\nexport const DATE_TIME_FORMAT_OPTIONS = {\r\n\r\n DATE_NUMERIC_MONTH: DATE_NUMERIC_MONTH_OPTIONS,\r\n DATE_SHORT_MONTH: DATE_SHORT_MONTH_OPTIONS,\r\n DATE_LONG_MONTH: DATE_LONG_MONTH_OPTIONS,\r\n\r\n DATE_LONG_MONTH_LONG_WEEKDAY: DATE_LONG_MONTH_LONG_WEEKDAY_OPTIONS,\r\n DATE_LONG_MONTH_SHORT_WEEKDAY: DATE_LONG_MONTH_SHORT_WEEKDAY_OPTIONS,\r\n\r\n TIME_HOUR_NUMERIC: TIME_HOUR_NUMERIC_OPTION,\r\n TIME_HOUR_2DIGIT: TIME_HOUR_2DIGIT_OPTION,\r\n TIME_HOUR_NUMERIC_SECONDS: TIME_HOUR_NUMERIC_SECONDS_OPTION,\r\n\r\n // SHORT_DATE_WITH_WEEKDAY: SHORT_DATE_WITH_WEEKDAY_OPTIONS,\r\n \r\n // Long formats\r\n// LONG_DATE_WITH_WEEKDAY: LONG_DATE_WITH_WEEKDAY_OPTIONS,\r\n\r\n // Time formats\r\n// TIME_12H: TIME_12H_OPTIONS,\r\n// TIME_24H: TIME_24H_OPTIONS,\r\n// TIME_WITH_SECONDS: TIME_WITH_SECONDS_OPTIONS,\r\n \r\n // DateTime combinations\r\n// SHORT_DATETIME: SHORT_DATETIME_OPTIONS,\r\n// LONG_DATETIME: LONG_DATETIME_OPTIONS,\r\n// COMPACT_DATETIME: COMPACT_DATETIME_OPTIONS,\r\n \r\n // Range specific\r\n \r\n// TIME_RANGE_WITH_DATE: TIME_RANGE_WITH_DATE_OPTIONS,\r\n// DATE_RANGE_MONTH: DATE_RANGE_MONTH_OPTIONS,\r\n// DATE_RANGE_YEAR: DATE_RANGE_YEAR_OPTIONS,\r\n \r\n // Special\r\n// RELATIVE_DATE: RELATIVE_DATE_OPTIONS,\r\n// MONTH_YEAR: MONTH_YEAR_OPTIONS,\r\n// WEEKDAY_ONLY: WEEKDAY_ONLY_OPTIONS,\r\n// YEAR_ONLY: YEAR_ONLY_OPTIONS\r\n} as const;\r\nexport type DateTimeFormatOptionKeys = keyof typeof DATE_TIME_FORMAT_OPTIONS;\r\n\r\n\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,uBAAuB,CAAA;AAChC,IAAA,SAAS,CACL,IAAU,EACV,E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;;;;;;;;;;;;;;;;;;;;;;ACtK/D;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -3,9 +3,10 @@ import * as i1 from "./date-period-format.pipe";
|
|
|
3
3
|
import * as i2 from "./date-format.pipe";
|
|
4
4
|
import * as i3 from "./date-time-range-format.pipe";
|
|
5
5
|
import * as i4 from "./date-compare.pipe";
|
|
6
|
-
import * as i5 from "
|
|
6
|
+
import * as i5 from "./date-time-range-duration.pipe";
|
|
7
|
+
import * as i6 from "@angular/common";
|
|
7
8
|
export declare class SdsDatePipesModule {
|
|
8
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdsDatePipesModule, never>;
|
|
9
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SdsDatePipesModule, [typeof i1.SdsDatePeriodFormatPipe, typeof i2.SdsDateFormatPipe, typeof i3.DateTimeRangeFormatPipe, typeof i4.SdsDateComparePipe], [typeof
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SdsDatePipesModule, [typeof i1.SdsDatePeriodFormatPipe, typeof i2.SdsDateFormatPipe, typeof i3.DateTimeRangeFormatPipe, typeof i4.SdsDateComparePipe, typeof i5.SdsDateTimeRangeDurationPipe], [typeof i6.CommonModule], [typeof i1.SdsDatePeriodFormatPipe, typeof i2.SdsDateFormatPipe, typeof i3.DateTimeRangeFormatPipe, typeof i4.SdsDateComparePipe, typeof i5.SdsDateTimeRangeDurationPipe]>;
|
|
10
11
|
static ɵinj: i0.ɵɵInjectorDeclaration<SdsDatePipesModule>;
|
|
11
12
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SdsDateTimeRangeDurationPipe implements PipeTransform {
|
|
4
|
+
transform(startDate: Date | string | number, endDate: Date | string | number): string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdsDateTimeRangeDurationPipe, never>;
|
|
6
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<SdsDateTimeRangeDurationPipe, "sdsDateTimeRangeDuration", false>;
|
|
7
|
+
}
|
|
@@ -2,5 +2,6 @@ export * from './date-pipes.module';
|
|
|
2
2
|
export * from './date-period-format.pipe';
|
|
3
3
|
export * from './date-format.pipe';
|
|
4
4
|
export * from './date-time-range-format.pipe';
|
|
5
|
+
export * from './date-time-range-duration.pipe';
|
|
5
6
|
export * from './date-time-formats.constants';
|
|
6
7
|
export * from './date-compare.pipe';
|