ensure we convert date ranges to ymd before saving to the task-data w/ burnettk

This commit is contained in:
jasquat 2023-07-14 11:28:00 -04:00
parent c1e0b58c07
commit 8c9a4be4aa
2 changed files with 7 additions and 3 deletions

View File

@ -83,7 +83,8 @@ export const PROCESS_STATUSES = [
];
// with time: yyyy-MM-dd HH:mm:ss
let generalDateFormat = 'yyyy-MM-dd';
// let generalDateFormat = 'yyyy-MM-dd';
let generalDateFormat = 'dd-MM-yyyy';
if (
'spiffworkflowFrontendJsenv' in window &&
'DATE_FORMAT' in window.spiffworkflowFrontendJsenv

View File

@ -8,6 +8,7 @@ import {
import {
convertDateObjectToFormattedString,
convertStringToDate,
dateStringToYMDFormat,
} from '../../../helpers';
interface widgetArgs {
@ -55,10 +56,12 @@ export default function DateRangePickerWidget({
let dateRangeString;
const startDate = convertDateObjectToFormattedString(dateRange[0]);
if (startDate) {
const startDateYMD = dateStringToYMDFormat(startDate);
const endDate = convertDateObjectToFormattedString(dateRange[1]);
dateRangeString = startDate;
dateRangeString = startDateYMD;
if (endDate) {
dateRangeString = `${dateRangeString}${DATE_RANGE_DELIMITER}${endDate}`;
const endDateYMD = dateStringToYMDFormat(endDate);
dateRangeString = `${dateRangeString}${DATE_RANGE_DELIMITER}${endDateYMD}`;
}
}
onChange(dateRangeString);