@resolveio/client-lib-core 0.0.4 → 0.0.5
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/lib/logger/logger.component.mjs +2 -3
- package/esm2020/lib/widgets/date-shortcut/date-shortcut.component.mjs +2 -3
- package/esm2020/lib/widgets/scheduler/scheduler.component.mjs +2 -3
- package/fesm2015/resolveio-client-lib-core.mjs +38 -41
- package/fesm2015/resolveio-client-lib-core.mjs.map +1 -1
- package/fesm2020/resolveio-client-lib-core.mjs +38 -41
- package/fesm2020/resolveio-client-lib-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ import * as i1$2 from 'ngx-localstorage';
|
|
|
12
12
|
import { NgxLocalStorageModule } from 'ngx-localstorage';
|
|
13
13
|
import { finalize } from 'rxjs/operators';
|
|
14
14
|
import { detailedDiff } from 'deep-object-diff';
|
|
15
|
-
import * as moment
|
|
15
|
+
import * as moment from 'moment';
|
|
16
16
|
import * as i1$3 from '@angular/router';
|
|
17
17
|
import { RouterModule } from '@angular/router';
|
|
18
18
|
import * as i3 from '@angular/common/http';
|
|
@@ -424,8 +424,8 @@ function getDeepDiffDetails(obj1, obj2) {
|
|
|
424
424
|
let key = Object.keys(diff['updated'])[i];
|
|
425
425
|
let newKey = Object.keys(newDiff['updated'])[i];
|
|
426
426
|
if ((key.substr(0, 2) !== 'id')) {
|
|
427
|
-
if (diff['updated'][key] && moment
|
|
428
|
-
diffString += 'Updated: \n' + toTitleCase(key.replace(/_/g, ' ')) + ': "' + moment
|
|
427
|
+
if (diff['updated'][key] && moment.isDate(diff['updated'][key])) {
|
|
428
|
+
diffString += 'Updated: \n' + toTitleCase(key.replace(/_/g, ' ')) + ': "' + moment(diff['updated'][key]).format('llll') + '" to "' + moment(newDiff['updated'][newKey]).format('llll') + '"\n';
|
|
429
429
|
}
|
|
430
430
|
else if (diff['updated'][key] && typeof (diff['updated'][key]) === 'object') {
|
|
431
431
|
let objString = '';
|
|
@@ -4612,7 +4612,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
4612
4612
|
}]
|
|
4613
4613
|
}] });
|
|
4614
4614
|
|
|
4615
|
-
const moment$2 = moment$3;
|
|
4616
4615
|
class LoggerComponent extends BaseComponent {
|
|
4617
4616
|
constructor(_services, _ds, _cd) {
|
|
4618
4617
|
super(_services);
|
|
@@ -4642,7 +4641,7 @@ class LoggerComponent extends BaseComponent {
|
|
|
4642
4641
|
}));
|
|
4643
4642
|
let jsDateStart = new Date();
|
|
4644
4643
|
jsDateStart.setHours(0, 0, 0, 0);
|
|
4645
|
-
let date_start = new Date(moment
|
|
4644
|
+
let date_start = new Date(moment(jsDateStart).subtract(10, 'days').toDate());
|
|
4646
4645
|
this.dateStartElem = { year: date_start.getFullYear(), month: date_start.getMonth() + 1, day: date_start.getDate() };
|
|
4647
4646
|
this.timeStartElem = { hour: 0, minute: 0, second: 0 };
|
|
4648
4647
|
let jsDateEnd = new Date();
|
|
@@ -8132,7 +8131,6 @@ function type(label) {
|
|
|
8132
8131
|
return label;
|
|
8133
8132
|
}
|
|
8134
8133
|
|
|
8135
|
-
const moment$1 = moment$3;
|
|
8136
8134
|
class DateShortcutComponent extends BaseComponent {
|
|
8137
8135
|
constructor(_services, _cd) {
|
|
8138
8136
|
super(_services);
|
|
@@ -8154,83 +8152,83 @@ class DateShortcutComponent extends BaseComponent {
|
|
|
8154
8152
|
}
|
|
8155
8153
|
onSelectShortcut() {
|
|
8156
8154
|
if (this.shortcutValue) {
|
|
8157
|
-
let startDate = moment
|
|
8158
|
-
let endDate = moment
|
|
8155
|
+
let startDate = moment(new Date(this.startDateObj['year'], this.startDateObj['month'] - 1, this.startDateObj['day'])).toDate();
|
|
8156
|
+
let endDate = moment(new Date(this.endDateObj['year'], this.endDateObj['month'] - 1, this.endDateObj['day'])).toDate();
|
|
8159
8157
|
if (this.shortcutValue === 'Q1') {
|
|
8160
|
-
startDate = moment
|
|
8161
|
-
endDate = moment
|
|
8158
|
+
startDate = moment().startOf('year').toDate();
|
|
8159
|
+
endDate = moment().startOf('year').quarter(2).subtract(1, 'days').toDate();
|
|
8162
8160
|
}
|
|
8163
8161
|
else if (this.shortcutValue === 'Q2') {
|
|
8164
|
-
startDate = moment
|
|
8165
|
-
endDate = moment
|
|
8162
|
+
startDate = moment().startOf('year').quarter(2).toDate();
|
|
8163
|
+
endDate = moment().startOf('year').quarter(3).subtract(1, 'days').toDate();
|
|
8166
8164
|
}
|
|
8167
8165
|
else if (this.shortcutValue === 'Q3') {
|
|
8168
|
-
startDate = moment
|
|
8169
|
-
endDate = moment
|
|
8166
|
+
startDate = moment().startOf('year').quarter(3).toDate();
|
|
8167
|
+
endDate = moment().startOf('year').quarter(4).subtract(1, 'days').toDate();
|
|
8170
8168
|
}
|
|
8171
8169
|
else if (this.shortcutValue === 'Q4') {
|
|
8172
|
-
startDate = moment
|
|
8173
|
-
endDate = moment
|
|
8170
|
+
startDate = moment().startOf('year').quarter(4).toDate();
|
|
8171
|
+
endDate = moment().endOf('year').toDate();
|
|
8174
8172
|
}
|
|
8175
8173
|
else if (this.shortcutValue === 'Last Q1') {
|
|
8176
|
-
startDate = moment
|
|
8177
|
-
endDate = moment
|
|
8174
|
+
startDate = moment().startOf('year').subtract(1, 'year').toDate();
|
|
8175
|
+
endDate = moment().startOf('year').subtract(1, 'year').quarter(2).subtract(1, 'days').toDate();
|
|
8178
8176
|
}
|
|
8179
8177
|
else if (this.shortcutValue === 'Last Q2') {
|
|
8180
|
-
startDate = moment
|
|
8181
|
-
endDate = moment
|
|
8178
|
+
startDate = moment().startOf('year').subtract(1, 'year').quarter(2).toDate();
|
|
8179
|
+
endDate = moment().startOf('year').subtract(1, 'year').quarter(3).subtract(1, 'days').toDate();
|
|
8182
8180
|
}
|
|
8183
8181
|
else if (this.shortcutValue === 'Last Q3') {
|
|
8184
|
-
startDate = moment
|
|
8185
|
-
endDate = moment
|
|
8182
|
+
startDate = moment().startOf('year').subtract(1, 'year').quarter(3).toDate();
|
|
8183
|
+
endDate = moment().startOf('year').subtract(1, 'year').quarter(4).subtract(1, 'days').toDate();
|
|
8186
8184
|
}
|
|
8187
8185
|
else if (this.shortcutValue === 'Last Q4') {
|
|
8188
|
-
startDate = moment
|
|
8189
|
-
endDate = moment
|
|
8186
|
+
startDate = moment().startOf('year').subtract(1, 'year').quarter(4).toDate();
|
|
8187
|
+
endDate = moment().endOf('year').subtract(1, 'year').toDate();
|
|
8190
8188
|
}
|
|
8191
8189
|
else if (this.shortcutValue === 'Today') {
|
|
8192
|
-
startDate = moment
|
|
8190
|
+
startDate = moment().startOf('day').toDate();
|
|
8193
8191
|
endDate = new Date();
|
|
8194
8192
|
}
|
|
8195
8193
|
else if (this.shortcutValue === 'Yesterday') {
|
|
8196
|
-
startDate = moment
|
|
8197
|
-
endDate = moment
|
|
8194
|
+
startDate = moment().subtract(1, 'days').startOf('day').toDate();
|
|
8195
|
+
endDate = moment().subtract(1, 'days').endOf('day').toDate();
|
|
8198
8196
|
}
|
|
8199
8197
|
else if (this.shortcutValue === 'Week') {
|
|
8200
|
-
startDate = moment
|
|
8198
|
+
startDate = moment().startOf('isoWeek').toDate();
|
|
8201
8199
|
endDate = new Date();
|
|
8202
8200
|
}
|
|
8203
8201
|
else if (this.shortcutValue === 'Last Week') {
|
|
8204
|
-
endDate = moment
|
|
8205
|
-
startDate = moment
|
|
8202
|
+
endDate = moment().startOf('isoWeek').subtract(1, 'days').toDate();
|
|
8203
|
+
startDate = moment(endDate).startOf('isoWeek').toDate();
|
|
8206
8204
|
}
|
|
8207
8205
|
else if (this.shortcutValue === 'Month') {
|
|
8208
|
-
startDate = moment
|
|
8206
|
+
startDate = moment().startOf('month').toDate();
|
|
8209
8207
|
endDate = new Date();
|
|
8210
8208
|
}
|
|
8211
8209
|
else if (this.shortcutValue === 'Last Month') {
|
|
8212
|
-
endDate = moment
|
|
8213
|
-
startDate = moment
|
|
8210
|
+
endDate = moment().startOf('month').subtract(1, 'days').endOf('day').toDate();
|
|
8211
|
+
startDate = moment(endDate).startOf('month').toDate();
|
|
8214
8212
|
}
|
|
8215
8213
|
else if (this.shortcutValue === 'Last 30 Days') {
|
|
8216
8214
|
endDate = new Date();
|
|
8217
|
-
startDate = moment
|
|
8215
|
+
startDate = moment().subtract(30, 'days').startOf('day').toDate();
|
|
8218
8216
|
}
|
|
8219
8217
|
else if (this.shortcutValue === 'Quarter') {
|
|
8220
|
-
startDate = moment
|
|
8218
|
+
startDate = moment().startOf('year').quarter(moment().quarter()).toDate();
|
|
8221
8219
|
endDate = new Date();
|
|
8222
8220
|
}
|
|
8223
8221
|
else if (this.shortcutValue === 'Last Quarter') {
|
|
8224
|
-
endDate = moment
|
|
8225
|
-
startDate = moment
|
|
8222
|
+
endDate = moment().startOf('year').quarter(moment().quarter()).subtract(1, 'days').endOf('day').toDate();
|
|
8223
|
+
startDate = moment(endDate).startOf('quarter').toDate();
|
|
8226
8224
|
}
|
|
8227
8225
|
else if (this.shortcutValue === 'Year') {
|
|
8228
|
-
startDate = moment
|
|
8226
|
+
startDate = moment().startOf('year').toDate();
|
|
8229
8227
|
endDate = new Date();
|
|
8230
8228
|
}
|
|
8231
8229
|
else if (this.shortcutValue === 'Last Year') {
|
|
8232
|
-
endDate = moment
|
|
8233
|
-
startDate = moment
|
|
8230
|
+
endDate = moment().startOf('year').subtract(1, 'days').endOf('day').toDate();
|
|
8231
|
+
startDate = moment(endDate).startOf('year').toDate();
|
|
8234
8232
|
}
|
|
8235
8233
|
else if (this.shortcutValue === 'All') {
|
|
8236
8234
|
startDate = new Date(2017, 0, 1, 0, 0, 0, 0);
|
|
@@ -8348,7 +8346,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImpor
|
|
|
8348
8346
|
}]
|
|
8349
8347
|
}] });
|
|
8350
8348
|
|
|
8351
|
-
const moment = moment$3;
|
|
8352
8349
|
class SchedulerComponent extends BaseComponent {
|
|
8353
8350
|
constructor(_services) {
|
|
8354
8351
|
super(_services);
|