ensure we convert date ranges to ymd before saving to the task-data w/ burnettk
This commit is contained in:
parent
c1e0b58c07
commit
8c9a4be4aa
|
@ -83,7 +83,8 @@ export const PROCESS_STATUSES = [
|
||||||
];
|
];
|
||||||
|
|
||||||
// with time: yyyy-MM-dd HH:mm:ss
|
// with time: yyyy-MM-dd HH:mm:ss
|
||||||
let generalDateFormat = 'yyyy-MM-dd';
|
// let generalDateFormat = 'yyyy-MM-dd';
|
||||||
|
let generalDateFormat = 'dd-MM-yyyy';
|
||||||
if (
|
if (
|
||||||
'spiffworkflowFrontendJsenv' in window &&
|
'spiffworkflowFrontendJsenv' in window &&
|
||||||
'DATE_FORMAT' in window.spiffworkflowFrontendJsenv
|
'DATE_FORMAT' in window.spiffworkflowFrontendJsenv
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
import {
|
import {
|
||||||
convertDateObjectToFormattedString,
|
convertDateObjectToFormattedString,
|
||||||
convertStringToDate,
|
convertStringToDate,
|
||||||
|
dateStringToYMDFormat,
|
||||||
} from '../../../helpers';
|
} from '../../../helpers';
|
||||||
|
|
||||||
interface widgetArgs {
|
interface widgetArgs {
|
||||||
|
@ -55,10 +56,12 @@ export default function DateRangePickerWidget({
|
||||||
let dateRangeString;
|
let dateRangeString;
|
||||||
const startDate = convertDateObjectToFormattedString(dateRange[0]);
|
const startDate = convertDateObjectToFormattedString(dateRange[0]);
|
||||||
if (startDate) {
|
if (startDate) {
|
||||||
|
const startDateYMD = dateStringToYMDFormat(startDate);
|
||||||
const endDate = convertDateObjectToFormattedString(dateRange[1]);
|
const endDate = convertDateObjectToFormattedString(dateRange[1]);
|
||||||
dateRangeString = startDate;
|
dateRangeString = startDateYMD;
|
||||||
if (endDate) {
|
if (endDate) {
|
||||||
dateRangeString = `${dateRangeString}${DATE_RANGE_DELIMITER}${endDate}`;
|
const endDateYMD = dateStringToYMDFormat(endDate);
|
||||||
|
dateRangeString = `${dateRangeString}${DATE_RANGE_DELIMITER}${endDateYMD}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onChange(dateRangeString);
|
onChange(dateRangeString);
|
||||||
|
|
Loading…
Reference in New Issue