@datarailsshared/datarailsshared 1.4.193-rocket → 1.4.195-rocket
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/datarailsshared-datarailsshared-1.4.195-rocket.tgz +0 -0
- package/esm2022/lib/date-tags/day-tag/day-tag.component.mjs +2 -3
- package/esm2022/lib/date-tags/forecast-tag/forecast-tag.component.mjs +2 -3
- package/esm2022/lib/date-tags/month-tag/month-tag.component.mjs +4 -3
- package/esm2022/lib/date-tags/quarter-tag/quarter-tag.component.mjs +2 -3
- package/esm2022/lib/date-tags/week-tag/week-tag.component.mjs +2 -3
- package/esm2022/lib/date-tags/year-tag/year-tag.component.mjs +2 -3
- package/esm2022/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.mjs +3 -4
- package/esm2022/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.mjs +10 -6
- package/esm2022/lib/dr-inputs/date-pickers/services/dr-date-picker.service.mjs +1 -3
- package/fesm2022/datarailsshared-datarailsshared.mjs +37 -51
- package/fesm2022/datarailsshared-datarailsshared.mjs.map +1 -1
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.193-rocket.tgz +0 -0
|
@@ -5,10 +5,10 @@ import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
|
|
|
5
5
|
import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular/material-moment-adapter';
|
|
6
6
|
import * as i1$4 from '@angular/material/core';
|
|
7
7
|
import { MAT_DATE_FORMATS, DateAdapter, MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core';
|
|
8
|
+
import * as moment from 'moment';
|
|
8
9
|
import * as i1$2 from '@angular/forms';
|
|
9
10
|
import { NG_VALUE_ACCESSOR, FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
10
11
|
import { BehaviorSubject, Subject, noop as noop$1, from, merge as merge$1, fromEvent } from 'rxjs';
|
|
11
|
-
import * as moment$9 from 'moment';
|
|
12
12
|
import * as _ from 'lodash';
|
|
13
13
|
import { find, reduce, isObject, isNil, map, isNumber, merge, forEach, some, orderBy, cloneDeep, filter as filter$1, indexOf, includes, pull, concat, isString, isBoolean } from 'lodash';
|
|
14
14
|
import { skip, takeUntil, debounceTime, distinctUntilChanged, startWith, switchMap, filter, first, catchError } from 'rxjs/operators';
|
|
@@ -170,7 +170,7 @@ class DrSharedUtils {
|
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
static getDateByTag(tag) {
|
|
173
|
-
const todayDate = moment
|
|
173
|
+
const todayDate = moment().utc().endOf('day');
|
|
174
174
|
switch (tag) {
|
|
175
175
|
case DateTags.TODAY:
|
|
176
176
|
return todayDate;
|
|
@@ -187,8 +187,6 @@ class DrSharedUtils {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
// @ts-ignore
|
|
191
|
-
const moment$8 = require('moment');
|
|
192
190
|
class DrDatePickerService {
|
|
193
191
|
isTimeframeSelectionEnabled = false;
|
|
194
192
|
timeframe = TimeframeOption.DAY;
|
|
@@ -875,8 +873,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
875
873
|
}]
|
|
876
874
|
}] });
|
|
877
875
|
|
|
878
|
-
// @ts-ignore
|
|
879
|
-
const moment$7 = require('moment');
|
|
880
876
|
class DrDatePickerCustomHeaderComponent {
|
|
881
877
|
_calendar;
|
|
882
878
|
_dateAdapter;
|
|
@@ -888,7 +884,7 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
888
884
|
selectedQuarter = 1;
|
|
889
885
|
timeframeOptions = [{
|
|
890
886
|
timeframe: TimeframeOption.DAY,
|
|
891
|
-
title: '
|
|
887
|
+
title: 'Day12313',
|
|
892
888
|
value: CalendarView.FOR_DAYS,
|
|
893
889
|
format: this.datePickerService.formatConfig.day,
|
|
894
890
|
periodLabel: () => this._dateAdapter.format(this._calendar.activeDate, this._dateFormats.display.monthYearLabel).toLocaleUpperCase()
|
|
@@ -903,20 +899,20 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
903
899
|
title: 'Month',
|
|
904
900
|
value: CalendarView.FOR_MONTHS,
|
|
905
901
|
format: this.datePickerService.formatConfig.month,
|
|
906
|
-
periodLabel: () => String(moment
|
|
902
|
+
periodLabel: () => String(moment(this._calendar.activeDate).utc().year())
|
|
907
903
|
}, {
|
|
908
904
|
timeframe: TimeframeOption.QUARTER,
|
|
909
905
|
title: 'Quarter',
|
|
910
906
|
value: CalendarView.FOR_QUARTERS,
|
|
911
907
|
format: this.datePickerService.formatConfig.quarter,
|
|
912
|
-
periodLabel: () => String(moment
|
|
908
|
+
periodLabel: () => String(moment(this.datePickerService.subtractFiscalYearMonthsFromDate(this._calendar.activeDate)).utc().year())
|
|
913
909
|
}, {
|
|
914
910
|
timeframe: TimeframeOption.YEAR,
|
|
915
911
|
title: 'Year',
|
|
916
912
|
value: CalendarView.FOR_YEARS,
|
|
917
913
|
format: this.datePickerService.formatConfig.year,
|
|
918
914
|
periodLabel: () => {
|
|
919
|
-
const currentYear = moment
|
|
915
|
+
const currentYear = moment(this.datePickerService.subtractFiscalYearMonthsFromDate(this._calendar.activeDate)).utc().year();
|
|
920
916
|
const startPeriod = Math.floor(currentYear / 24) * 24;
|
|
921
917
|
return startPeriod + '-' + (startPeriod + 23);
|
|
922
918
|
}
|
|
@@ -1039,11 +1035,15 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
1039
1035
|
this.datePickerService.updateDatePickerByPreset(this.selectedPresetTag, this._calendar);
|
|
1040
1036
|
}
|
|
1041
1037
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: DrDatePickerCustomHeaderComponent, deps: [{ token: i1$3.MatCalendar }, { token: i1$4.DateAdapter }, { token: MAT_DATE_FORMATS }, { token: i0.ChangeDetectorRef }, { token: DrDatePickerService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1042
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: DrDatePickerCustomHeaderComponent, selector: "dr-date-picker_custom-header.component",
|
|
1038
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.5", type: DrDatePickerCustomHeaderComponent, selector: "dr-date-picker_custom-header.component", providers: [
|
|
1039
|
+
{ provide: DrDatePickerService }
|
|
1040
|
+
], ngImport: i0, template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n\n <div *ngIf=\"datePickerService.isUsingDateTagPresets\" class=\"dr-datepicker-preset-date\">\n <div class=\"dr-datepicker-preset-date__tags\">\n <div *ngFor=\"let tag of presetTagList\" \n id=\"preset_tag\" \n class=\"dr-datepicker-preset-date__tags__tag\" \n (click)=\"onSelectPresetTag(tag)\" \n [ngClass]=\"{'dr-datepicker-preset-date__tags__tag--selected': tag.key === selectedPresetTag}\"\n [drTooltip]=\"selectedPresetTag === tag.key? 'Unselect preset' : ''\"\n [drTooltipPosition]=\"'top'\">\n {{ tag.label }}\n </div>\n </div>\n </div>\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [ngModel]=\"selectedTimeframe\"\n [items]=\"timeframeOptions | drShowTimeframePipe: datePickerService.availableTimeframes\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe($event)\">\n </dr-select>\n</div>\n\n<div class=\"dr-date-paging\">\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(false)\">\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i>\n </div>\n <span class=\"example-header-label\">\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_MONTHS)\">{{ periodMonthLabel + ' ' }}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_YEARS)\">{{ periodYearLabel }}</span>\n </span>\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n</div>\n<div #quarterlyDatePicker class=\"dr-quarterly-datepicker\" *ngIf=\"currentViewIsQuarter\">\n <div *ngFor=\"let quarter of quarters\"\n class=\"quarter-selector\" (click)=\"onSelectQuarter(quarter)\"\n [class]=\"quarter === selectedQuarter ? 'selected' : ''\"\n >Q{{quarter}}</div>\n</div>\n\n", styles: [":host{height:54px;align-items:center;font-family:Poppins;font-style:normal;font-weight:600;font-size:14px;line-height:22px}.dr-datepicker__timeframe-select__wrapper{background-color:#f9faff;padding:16px 32px;border-radius:18px 18px 0 0}.dr-datepicker-preset-date{display:flex;flex-direction:column}.dr-datepicker-preset-date__tags{display:flex;padding-bottom:21px;padding-top:10px;font-size:12px}.dr-datepicker-preset-date__tags__tag{cursor:pointer;font-weight:400;line-height:20px!important;padding:2px 8px;border:1px solid #9EA1AA;border-radius:18px;background:#FFFFFF;margin-right:4px}.dr-datepicker-preset-date__tags__tag--selected{color:#4646ce;background:#F2F2FB;border:1px solid #4646CE}.dr-date-paging{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 32px;gap:4px}.dr-date-paging.flip-page-button{width:20px;height:20px;padding:0;color:#4e566c}.dr-date-paging.flip-page-button:hover{border-radius:50%;background:#f2f2fb;color:#4646ce}.example-header-label{cursor:pointer}.dr-quarterly-datepicker{display:flex;justify-content:space-between;padding:10px}.dr-quarterly-datepicker .quarter-selector{display:block;width:74px;height:40px;text-align:center;border-radius:40px;font-weight:400;padding-top:9px}.dr-quarterly-datepicker .quarter-selector:hover{background:#f2f2fb;color:#4646ce;font-weight:600;cursor:pointer}.dr-quarterly-datepicker .quarter-selector.selected{background-color:#4646ce;color:#f3f7ff;font-weight:600}\n"], dependencies: [{ kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: DrTooltipDirective, selector: "[drTooltip]", inputs: ["drTooltip", "drTooltipContext", "drTooltipPosition", "drTooltipClass", "drTooltipMousleaveTimeout", "drTooltipOptions", "drTooltipShow"] }, { kind: "component", type: DrSelectComponent, selector: "dr-select", inputs: ["className", "items", "addTag", "appendTo", "bindLabel", "bindValue", "clearable", "searchable", "searchFn", "multiple", "hideSelected", "placeholder", "loading", "readonly", "disabled", "groupBy", "optionWithDescription", "id", "keyDownFn", "selectedItem", "dropdownClass", "closeOnSelect", "textView", "autofocus", "isOpen"], outputs: ["change", "open"] }, { kind: "pipe", type: DrShowTimeframePipe, name: "drShowTimeframePipe" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1043
1041
|
}
|
|
1044
1042
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImport: i0, type: DrDatePickerCustomHeaderComponent, decorators: [{
|
|
1045
1043
|
type: Component,
|
|
1046
|
-
args: [{ selector: 'dr-date-picker_custom-header.component', changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1044
|
+
args: [{ selector: 'dr-date-picker_custom-header.component', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1045
|
+
{ provide: DrDatePickerService }
|
|
1046
|
+
], template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n\n <div *ngIf=\"datePickerService.isUsingDateTagPresets\" class=\"dr-datepicker-preset-date\">\n <div class=\"dr-datepicker-preset-date__tags\">\n <div *ngFor=\"let tag of presetTagList\" \n id=\"preset_tag\" \n class=\"dr-datepicker-preset-date__tags__tag\" \n (click)=\"onSelectPresetTag(tag)\" \n [ngClass]=\"{'dr-datepicker-preset-date__tags__tag--selected': tag.key === selectedPresetTag}\"\n [drTooltip]=\"selectedPresetTag === tag.key? 'Unselect preset' : ''\"\n [drTooltipPosition]=\"'top'\">\n {{ tag.label }}\n </div>\n </div>\n </div>\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [ngModel]=\"selectedTimeframe\"\n [items]=\"timeframeOptions | drShowTimeframePipe: datePickerService.availableTimeframes\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe($event)\">\n </dr-select>\n</div>\n\n<div class=\"dr-date-paging\">\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(false)\">\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i>\n </div>\n <span class=\"example-header-label\">\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_MONTHS)\">{{ periodMonthLabel + ' ' }}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_YEARS)\">{{ periodYearLabel }}</span>\n </span>\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n</div>\n<div #quarterlyDatePicker class=\"dr-quarterly-datepicker\" *ngIf=\"currentViewIsQuarter\">\n <div *ngFor=\"let quarter of quarters\"\n class=\"quarter-selector\" (click)=\"onSelectQuarter(quarter)\"\n [class]=\"quarter === selectedQuarter ? 'selected' : ''\"\n >Q{{quarter}}</div>\n</div>\n\n", styles: [":host{height:54px;align-items:center;font-family:Poppins;font-style:normal;font-weight:600;font-size:14px;line-height:22px}.dr-datepicker__timeframe-select__wrapper{background-color:#f9faff;padding:16px 32px;border-radius:18px 18px 0 0}.dr-datepicker-preset-date{display:flex;flex-direction:column}.dr-datepicker-preset-date__tags{display:flex;padding-bottom:21px;padding-top:10px;font-size:12px}.dr-datepicker-preset-date__tags__tag{cursor:pointer;font-weight:400;line-height:20px!important;padding:2px 8px;border:1px solid #9EA1AA;border-radius:18px;background:#FFFFFF;margin-right:4px}.dr-datepicker-preset-date__tags__tag--selected{color:#4646ce;background:#F2F2FB;border:1px solid #4646CE}.dr-date-paging{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 32px;gap:4px}.dr-date-paging.flip-page-button{width:20px;height:20px;padding:0;color:#4e566c}.dr-date-paging.flip-page-button:hover{border-radius:50%;background:#f2f2fb;color:#4646ce}.example-header-label{cursor:pointer}.dr-quarterly-datepicker{display:flex;justify-content:space-between;padding:10px}.dr-quarterly-datepicker .quarter-selector{display:block;width:74px;height:40px;text-align:center;border-radius:40px;font-weight:400;padding-top:9px}.dr-quarterly-datepicker .quarter-selector:hover{background:#f2f2fb;color:#4646ce;font-weight:600;cursor:pointer}.dr-quarterly-datepicker .quarter-selector.selected{background-color:#4646ce;color:#f3f7ff;font-weight:600}\n"] }]
|
|
1047
1047
|
}], ctorParameters: function () { return [{ type: i1$3.MatCalendar }, { type: i1$4.DateAdapter }, { type: CustomDateFormat, decorators: [{
|
|
1048
1048
|
type: Inject,
|
|
1049
1049
|
args: [MAT_DATE_FORMATS]
|
|
@@ -1109,8 +1109,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
1109
1109
|
args: ['drDatePickerFormat']
|
|
1110
1110
|
}] } });
|
|
1111
1111
|
|
|
1112
|
-
// @ts-ignore
|
|
1113
|
-
const moment$6 = require('moment');
|
|
1114
1112
|
const noop = () => {
|
|
1115
1113
|
};
|
|
1116
1114
|
class DrDatePickerComponent {
|
|
@@ -1121,10 +1119,10 @@ class DrDatePickerComponent {
|
|
|
1121
1119
|
this.datePickerService.updateTimeframeAndFormat(value);
|
|
1122
1120
|
}
|
|
1123
1121
|
set min(minDate) {
|
|
1124
|
-
this._min = moment
|
|
1122
|
+
this._min = moment.unix(minDate).utc();
|
|
1125
1123
|
}
|
|
1126
1124
|
set max(maxDate) {
|
|
1127
|
-
this._max = moment
|
|
1125
|
+
this._max = moment.unix(maxDate).utc();
|
|
1128
1126
|
}
|
|
1129
1127
|
// Whether to transform date, taking end, start, middle of preiod (i.e. set middle of month if timeframe='month')
|
|
1130
1128
|
periodPosition = DatePickerPeriodPosition.DEFAULT;
|
|
@@ -1247,8 +1245,8 @@ class DrDatePickerComponent {
|
|
|
1247
1245
|
* We need keep local timestamp for Electron Application
|
|
1248
1246
|
* Issue in electron: when we select date, date select with -1 (if we're choosing 2023, output will be 2022)
|
|
1249
1247
|
*/
|
|
1250
|
-
const convertedValue = document.is_electron ? moment
|
|
1251
|
-
this.innerValue = value ? convertedValue :
|
|
1248
|
+
const convertedValue = document.is_electron ? moment.unix(value) : moment.unix(value).utc();
|
|
1249
|
+
this.innerValue = value ? convertedValue : null;
|
|
1252
1250
|
if (this.innerValue) {
|
|
1253
1251
|
this.tryToNormalaizeTimeframe();
|
|
1254
1252
|
}
|
|
@@ -1329,8 +1327,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
1329
1327
|
args: ['datePicker']
|
|
1330
1328
|
}] } });
|
|
1331
1329
|
|
|
1332
|
-
// @ts-ignore
|
|
1333
|
-
const moment$5 = require('moment');
|
|
1334
1330
|
const DAY_FORMATS = {
|
|
1335
1331
|
parse: {
|
|
1336
1332
|
dateInput: 'DD-MM-YYYY',
|
|
@@ -1344,7 +1340,7 @@ const DAY_FORMATS = {
|
|
|
1344
1340
|
};
|
|
1345
1341
|
class DayTagComponent extends AnyTagComponent {
|
|
1346
1342
|
get isLocked() {
|
|
1347
|
-
return this.date ? !this.dateFilter(moment
|
|
1343
|
+
return this.date ? !this.dateFilter(moment.unix(this.date)) : false;
|
|
1348
1344
|
}
|
|
1349
1345
|
lockedDate = [];
|
|
1350
1346
|
date;
|
|
@@ -1352,7 +1348,7 @@ class DayTagComponent extends AnyTagComponent {
|
|
|
1352
1348
|
super();
|
|
1353
1349
|
}
|
|
1354
1350
|
initDate() {
|
|
1355
|
-
this.date = this.defaultValue || moment
|
|
1351
|
+
this.date = this.defaultValue || moment().unix();
|
|
1356
1352
|
this.dateObj.date = this.date;
|
|
1357
1353
|
}
|
|
1358
1354
|
initName() {
|
|
@@ -1361,7 +1357,7 @@ class DayTagComponent extends AnyTagComponent {
|
|
|
1361
1357
|
}
|
|
1362
1358
|
}
|
|
1363
1359
|
chosenTagHandler(value) {
|
|
1364
|
-
const date = moment
|
|
1360
|
+
const date = moment.unix(value);
|
|
1365
1361
|
const resultTag = {
|
|
1366
1362
|
name: this.name,
|
|
1367
1363
|
value: date.unix(),
|
|
@@ -1374,7 +1370,7 @@ class DayTagComponent extends AnyTagComponent {
|
|
|
1374
1370
|
dateFilter(momentData) {
|
|
1375
1371
|
const date = momentData.date();
|
|
1376
1372
|
return !this.lockedDate.some((timestamp) => {
|
|
1377
|
-
const lockDate = moment
|
|
1373
|
+
const lockDate = moment.unix(timestamp);
|
|
1378
1374
|
return lockDate.date() === date;
|
|
1379
1375
|
});
|
|
1380
1376
|
}
|
|
@@ -1406,8 +1402,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
1406
1402
|
type: Input
|
|
1407
1403
|
}] } });
|
|
1408
1404
|
|
|
1409
|
-
// @ts-ignore
|
|
1410
|
-
const moment$4 = require('moment');
|
|
1411
1405
|
const WEEK_FORMATS = {
|
|
1412
1406
|
parse: {
|
|
1413
1407
|
dateInput: 'WW-YYYY',
|
|
@@ -1421,7 +1415,7 @@ const WEEK_FORMATS = {
|
|
|
1421
1415
|
};
|
|
1422
1416
|
class WeekTagComponent extends AnyTagComponent {
|
|
1423
1417
|
get isLocked() {
|
|
1424
|
-
return this.date ? !this.dateFilter(moment
|
|
1418
|
+
return this.date ? !this.dateFilter(moment.unix(this.date)) : false;
|
|
1425
1419
|
}
|
|
1426
1420
|
lockedDate = [];
|
|
1427
1421
|
date;
|
|
@@ -1430,7 +1424,7 @@ class WeekTagComponent extends AnyTagComponent {
|
|
|
1430
1424
|
}
|
|
1431
1425
|
ngOnInit() {
|
|
1432
1426
|
this.initName();
|
|
1433
|
-
const timestamp = this.defaultValue || moment
|
|
1427
|
+
const timestamp = this.defaultValue || moment().unix();
|
|
1434
1428
|
this.date = timestamp;
|
|
1435
1429
|
this.dateObj.date = timestamp;
|
|
1436
1430
|
this.chosenTagHandler(timestamp);
|
|
@@ -1444,13 +1438,13 @@ class WeekTagComponent extends AnyTagComponent {
|
|
|
1444
1438
|
const week = date.week();
|
|
1445
1439
|
const year = date.year();
|
|
1446
1440
|
return !this.lockedDate.some((timestamp) => {
|
|
1447
|
-
const lockDate = moment
|
|
1441
|
+
const lockDate = moment.unix(timestamp);
|
|
1448
1442
|
return lockDate.week() === week && lockDate.year() === year;
|
|
1449
1443
|
});
|
|
1450
1444
|
}
|
|
1451
1445
|
;
|
|
1452
1446
|
chosenTagHandler(value) {
|
|
1453
|
-
const resultDate = moment
|
|
1447
|
+
const resultDate = moment.unix(value);
|
|
1454
1448
|
const resultTag = {
|
|
1455
1449
|
name: this.name,
|
|
1456
1450
|
value: resultDate.unix(),
|
|
@@ -1490,8 +1484,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
1490
1484
|
type: Input
|
|
1491
1485
|
}] } });
|
|
1492
1486
|
|
|
1493
|
-
// @ts-ignore
|
|
1494
|
-
const moment$3 = require('moment');
|
|
1495
1487
|
const MONTH_FORMATS = {
|
|
1496
1488
|
parse: {
|
|
1497
1489
|
dateInput: 'DD-MM-YYYY',
|
|
@@ -1505,7 +1497,7 @@ const MONTH_FORMATS = {
|
|
|
1505
1497
|
};
|
|
1506
1498
|
class MonthTagComponent extends AnyTagComponent {
|
|
1507
1499
|
get isLocked() {
|
|
1508
|
-
return this.date ? !this.dateFilter(moment
|
|
1500
|
+
return this.date ? !this.dateFilter(moment.unix(this.date)) : false;
|
|
1509
1501
|
}
|
|
1510
1502
|
lockedDate = [];
|
|
1511
1503
|
date;
|
|
@@ -1513,7 +1505,7 @@ class MonthTagComponent extends AnyTagComponent {
|
|
|
1513
1505
|
super();
|
|
1514
1506
|
}
|
|
1515
1507
|
initDate() {
|
|
1516
|
-
this.date = this.defaultValue || moment
|
|
1508
|
+
this.date = this.defaultValue || moment().unix();
|
|
1517
1509
|
this.dateObj.date = this.date;
|
|
1518
1510
|
}
|
|
1519
1511
|
initName() {
|
|
@@ -1522,7 +1514,7 @@ class MonthTagComponent extends AnyTagComponent {
|
|
|
1522
1514
|
}
|
|
1523
1515
|
}
|
|
1524
1516
|
chosenTagHandler(value) {
|
|
1525
|
-
const resultDate = moment
|
|
1517
|
+
const resultDate = moment.unix(value);
|
|
1526
1518
|
resultDate.hour(12);
|
|
1527
1519
|
const resultTag = {
|
|
1528
1520
|
name: this.name,
|
|
@@ -1538,7 +1530,7 @@ class MonthTagComponent extends AnyTagComponent {
|
|
|
1538
1530
|
const month = date.month();
|
|
1539
1531
|
const year = date.year();
|
|
1540
1532
|
return !this.lockedDate.some((timestamp) => {
|
|
1541
|
-
const lockDate = moment
|
|
1533
|
+
const lockDate = moment.unix(timestamp);
|
|
1542
1534
|
return lockDate.year() === year && lockDate.month() === month;
|
|
1543
1535
|
});
|
|
1544
1536
|
}
|
|
@@ -1570,12 +1562,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
1570
1562
|
type: Input
|
|
1571
1563
|
}] } });
|
|
1572
1564
|
|
|
1573
|
-
// @ts-ignore
|
|
1574
|
-
const moment$2 = require('moment');
|
|
1575
1565
|
class QuarterTagComponent extends AnyTagComponent {
|
|
1576
1566
|
get isLocked() {
|
|
1577
1567
|
return this.quarters
|
|
1578
|
-
? this.quarters.some((quarter) => !this.dateFilter(moment
|
|
1568
|
+
? this.quarters.some((quarter) => !this.dateFilter(moment.unix(quarter.value)))
|
|
1579
1569
|
: false;
|
|
1580
1570
|
}
|
|
1581
1571
|
lockedDate = [];
|
|
@@ -1602,7 +1592,7 @@ class QuarterTagComponent extends AnyTagComponent {
|
|
|
1602
1592
|
}
|
|
1603
1593
|
}
|
|
1604
1594
|
chosenTagHandler(quarter) {
|
|
1605
|
-
const resultDate = moment
|
|
1595
|
+
const resultDate = moment.unix(quarter.value);
|
|
1606
1596
|
const resultTag = {
|
|
1607
1597
|
name: this.name,
|
|
1608
1598
|
value: resultDate.unix(),
|
|
@@ -1648,9 +1638,9 @@ class QuarterTagComponent extends AnyTagComponent {
|
|
|
1648
1638
|
return Date.UTC(date.getFullYear(), month, 1, 12, 0, 0, 0);
|
|
1649
1639
|
}
|
|
1650
1640
|
dateFilter(quarter) {
|
|
1651
|
-
const quarterDate = moment
|
|
1641
|
+
const quarterDate = moment.unix(quarter.value);
|
|
1652
1642
|
return !this.lockedDate.some((timestamp) => {
|
|
1653
|
-
const lockDate = moment
|
|
1643
|
+
const lockDate = moment.unix(timestamp);
|
|
1654
1644
|
if (lockDate.year() === quarterDate.year() && lockDate.month() === quarterDate.month()) {
|
|
1655
1645
|
quarter.disabled = true;
|
|
1656
1646
|
return true;
|
|
@@ -1672,8 +1662,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
1672
1662
|
type: Input
|
|
1673
1663
|
}] } });
|
|
1674
1664
|
|
|
1675
|
-
// @ts-ignore
|
|
1676
|
-
const moment$1 = require('moment');
|
|
1677
1665
|
const YEAR_FORMATS = {
|
|
1678
1666
|
parse: {
|
|
1679
1667
|
dateInput: 'YYYY',
|
|
@@ -1687,7 +1675,7 @@ const YEAR_FORMATS = {
|
|
|
1687
1675
|
};
|
|
1688
1676
|
class YearTagComponent extends AnyTagComponent {
|
|
1689
1677
|
get isLocked() {
|
|
1690
|
-
return this.date ? !this.dateFilter(moment
|
|
1678
|
+
return this.date ? !this.dateFilter(moment.unix(this.date)) : false;
|
|
1691
1679
|
}
|
|
1692
1680
|
lockedDate = [];
|
|
1693
1681
|
date;
|
|
@@ -1695,7 +1683,7 @@ class YearTagComponent extends AnyTagComponent {
|
|
|
1695
1683
|
super();
|
|
1696
1684
|
}
|
|
1697
1685
|
initDate() {
|
|
1698
|
-
this.date = this.defaultValue || moment
|
|
1686
|
+
this.date = this.defaultValue || moment().unix();
|
|
1699
1687
|
this.dateObj.date = this.date;
|
|
1700
1688
|
}
|
|
1701
1689
|
initName() {
|
|
@@ -1704,7 +1692,7 @@ class YearTagComponent extends AnyTagComponent {
|
|
|
1704
1692
|
}
|
|
1705
1693
|
}
|
|
1706
1694
|
chosenTagHandler(value) {
|
|
1707
|
-
const resultDate = moment
|
|
1695
|
+
const resultDate = moment.unix(value);
|
|
1708
1696
|
resultDate.hour(12);
|
|
1709
1697
|
const resultTag = {
|
|
1710
1698
|
name: this.name,
|
|
@@ -1718,7 +1706,7 @@ class YearTagComponent extends AnyTagComponent {
|
|
|
1718
1706
|
dateFilter(date) {
|
|
1719
1707
|
const calendarDateYear = date.year();
|
|
1720
1708
|
return !this.lockedDate.some((timestamp) => {
|
|
1721
|
-
const lockDate = moment
|
|
1709
|
+
const lockDate = moment.unix(timestamp);
|
|
1722
1710
|
return lockDate.year() === calendarDateYear;
|
|
1723
1711
|
});
|
|
1724
1712
|
}
|
|
@@ -1750,8 +1738,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.5", ngImpor
|
|
|
1750
1738
|
type: Input
|
|
1751
1739
|
}] } });
|
|
1752
1740
|
|
|
1753
|
-
// @ts-ignore
|
|
1754
|
-
const moment = require('moment');
|
|
1755
1741
|
class ForecastTagComponent extends AnyTagComponent {
|
|
1756
1742
|
fiscalYearStartsFrom;
|
|
1757
1743
|
fiscalYearBack;
|
|
@@ -2542,7 +2528,7 @@ class DrDynamicTagComponent {
|
|
|
2542
2528
|
}
|
|
2543
2529
|
tryToParseParentValue(connectedTags) {
|
|
2544
2530
|
if (isNumber(connectedTags.value)) {
|
|
2545
|
-
const momentData = moment
|
|
2531
|
+
const momentData = moment.unix(connectedTags.value);
|
|
2546
2532
|
const convertedParentValue = momentData.get('year'); // TODO: add input prop (selectedTimeDimension) or Format
|
|
2547
2533
|
if (momentData.isValid() && convertedParentValue) {
|
|
2548
2534
|
return convertedParentValue;
|