vc-create-dashboard 2.8.19 → 2.8.20

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.
@@ -3279,6 +3279,15 @@ class CreateDashboardComponent {
3279
3279
  let today = new Date(data);
3280
3280
  return today.getDate() + '-' + (today.getMonth() + 1) + '-' + today.getFullYear();
3281
3281
  }
3282
+ /**
3283
+ * It takes a string, converts it to a date, then returns a string in the format of YYYY-MM-DD.
3284
+ * @param {string} data - the date you want to format
3285
+ * @returns A string in the format of YYYY-MM-DD
3286
+ */
3287
+ getDateFormate(data) {
3288
+ let today = new Date(data);
3289
+ return today.getFullYear() + '-' + String((today.getMonth() + 1)).padStart(2, '0') + '-' + String(today.getDate()).padStart(2, '0');
3290
+ }
3282
3291
  configureDashboard() {
3283
3292
  let fieldsStatus = this.validateDashboard();
3284
3293
  if (fieldsStatus) {
@@ -3742,8 +3751,8 @@ class CreateDashboardComponent {
3742
3751
  risk_category: this.returnIds(dashboard.selectedRiskCategories, 'category_id'),
3743
3752
  display_criteria: (dashboard.displayCriteria === 'and') ? 'BOTH_RC_AND_CATEGORY' : 'RC_OR_CATEGORY',
3744
3753
  timeframe: {
3745
- start_date: (dashboard.selectedFromDate) ? this.getFromDate(dashboard === null || dashboard === void 0 ? void 0 : dashboard.selectedFromDate) : '',
3746
- end_date: (dashboard.selectedToDate) ? this.setToDate(dashboard === null || dashboard === void 0 ? void 0 : dashboard.selectedToDate) : '',
3754
+ start_date: (dashboard.selectedFromDate) ? this.getDateFormate(dashboard === null || dashboard === void 0 ? void 0 : dashboard.selectedFromDate) : '',
3755
+ end_date: (dashboard.selectedToDate) ? this.getDateFormate(dashboard === null || dashboard === void 0 ? void 0 : dashboard.selectedToDate) : '',
3747
3756
  },
3748
3757
  email_summary: this.setFrequency('', 'export'),
3749
3758
  widget_details: dashboard.configureWidget