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.
@@ -3253,6 +3253,15 @@ class CreateDashboardComponent {
3253
3253
  let today = new Date(data);
3254
3254
  return today.getDate() + '-' + (today.getMonth() + 1) + '-' + today.getFullYear();
3255
3255
  }
3256
+ /**
3257
+ * It takes a string, converts it to a date, then returns a string in the format of YYYY-MM-DD.
3258
+ * @param {string} data - the date you want to format
3259
+ * @returns A string in the format of YYYY-MM-DD
3260
+ */
3261
+ getDateFormate(data) {
3262
+ let today = new Date(data);
3263
+ return today.getFullYear() + '-' + String((today.getMonth() + 1)).padStart(2, '0') + '-' + String(today.getDate()).padStart(2, '0');
3264
+ }
3256
3265
  configureDashboard() {
3257
3266
  let fieldsStatus = this.validateDashboard();
3258
3267
  if (fieldsStatus) {
@@ -3712,8 +3721,8 @@ class CreateDashboardComponent {
3712
3721
  risk_category: this.returnIds(dashboard.selectedRiskCategories, 'category_id'),
3713
3722
  display_criteria: (dashboard.displayCriteria === 'and') ? 'BOTH_RC_AND_CATEGORY' : 'RC_OR_CATEGORY',
3714
3723
  timeframe: {
3715
- start_date: (dashboard.selectedFromDate) ? this.getFromDate(dashboard?.selectedFromDate) : '',
3716
- end_date: (dashboard.selectedToDate) ? this.setToDate(dashboard?.selectedToDate) : '',
3724
+ start_date: (dashboard.selectedFromDate) ? this.getDateFormate(dashboard?.selectedFromDate) : '',
3725
+ end_date: (dashboard.selectedToDate) ? this.getDateFormate(dashboard?.selectedToDate) : '',
3717
3726
  },
3718
3727
  email_summary: this.setFrequency('', 'export'),
3719
3728
  widget_details: dashboard.configureWidget