tango-app-ui-shared 3.3.1-beta.85 → 3.3.1-beta.86
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.
|
@@ -4145,6 +4145,7 @@ class TraxHeaderComponent {
|
|
|
4145
4145
|
this.resetFilters();
|
|
4146
4146
|
// console.log("2")
|
|
4147
4147
|
}
|
|
4148
|
+
this.ranges = this.getDateRanges(this.selectedFilters.client);
|
|
4148
4149
|
}
|
|
4149
4150
|
syncWithLocalStorage(items) {
|
|
4150
4151
|
return items
|
|
@@ -4274,15 +4275,49 @@ class TraxHeaderComponent {
|
|
|
4274
4275
|
// Trigger change detection to reflect UI changes
|
|
4275
4276
|
this.cd.detectChanges();
|
|
4276
4277
|
}
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4278
|
+
getDateRanges(client) {
|
|
4279
|
+
if (client === '11') {
|
|
4280
|
+
return {
|
|
4281
|
+
Today: [dayjs(), dayjs()],
|
|
4282
|
+
Yesterday: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
|
4283
|
+
'This Week': [dayjs().subtract(7, 'days'), dayjs().subtract(1, 'days')],
|
|
4284
|
+
'Last Week': [
|
|
4285
|
+
dayjs().subtract(14, 'days').startOf('day'),
|
|
4286
|
+
dayjs().subtract(8, 'days').endOf('day'),
|
|
4287
|
+
],
|
|
4288
|
+
};
|
|
4289
|
+
}
|
|
4290
|
+
else {
|
|
4291
|
+
return {
|
|
4292
|
+
Today: [dayjs(), dayjs()],
|
|
4293
|
+
Yesterday: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
|
4294
|
+
'This Week': [dayjs().subtract(7, 'days'), dayjs().subtract(1, 'days')],
|
|
4295
|
+
'Last Week': [
|
|
4296
|
+
dayjs().subtract(14, 'days').startOf('day'),
|
|
4297
|
+
dayjs().subtract(8, 'days').endOf('day'),
|
|
4298
|
+
],
|
|
4299
|
+
'This Month': [dayjs().subtract(30, 'days'), dayjs().subtract(1, 'days')],
|
|
4300
|
+
'Last Month': [
|
|
4301
|
+
dayjs().subtract(1, 'month').startOf('month'),
|
|
4302
|
+
dayjs().subtract(1, 'month').endOf('month'),
|
|
4303
|
+
],
|
|
4304
|
+
};
|
|
4305
|
+
}
|
|
4306
|
+
}
|
|
4307
|
+
ranges = {};
|
|
4308
|
+
// Today: [dayjs(), dayjs()],
|
|
4309
|
+
// Yesterday: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
|
4310
|
+
// 'This Week': [dayjs().subtract(7, 'days'), dayjs().subtract(1, 'days')],
|
|
4311
|
+
// 'Last Week': [
|
|
4312
|
+
// dayjs().subtract(14, 'days').startOf('day'),
|
|
4313
|
+
// dayjs().subtract(8, 'days').endOf('day'),
|
|
4314
|
+
// ],
|
|
4315
|
+
// 'This Month': [dayjs().subtract(30, 'days'), dayjs().subtract(1, 'days')],
|
|
4316
|
+
// 'Last Month': [
|
|
4317
|
+
// dayjs().subtract(1, 'month').startOf('month'),
|
|
4318
|
+
// dayjs().subtract(1, 'month').endOf('month'),
|
|
4319
|
+
// ],
|
|
4320
|
+
// };
|
|
4286
4321
|
resetValidation() {
|
|
4287
4322
|
this.isCustomDate = (m) => {
|
|
4288
4323
|
// Check if the given date is before yesterday
|
|
@@ -4291,18 +4326,18 @@ class TraxHeaderComponent {
|
|
|
4291
4326
|
}
|
|
4292
4327
|
onStartDateChange(event) {
|
|
4293
4328
|
if (this.dayjs(event.startDate).isValid()) {
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4329
|
+
if (this.selectedFilters.client === '11') {
|
|
4330
|
+
this.isCustomDate = (m) => {
|
|
4331
|
+
const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(6, "days"));
|
|
4332
|
+
return isValidDate ? "invalid-date" : false;
|
|
4333
|
+
};
|
|
4334
|
+
}
|
|
4335
|
+
else {
|
|
4336
|
+
this.isCustomDate = (m) => {
|
|
4337
|
+
const isValidDate = m > this.dayjs() || m > this.dayjs(event.startDate.add(30, "days"));
|
|
4338
|
+
return isValidDate ? "invalid-date" : false;
|
|
4339
|
+
};
|
|
4340
|
+
}
|
|
4306
4341
|
}
|
|
4307
4342
|
}
|
|
4308
4343
|
datechange(event) {
|