mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
parent
b700c307c3
commit
71d0815891
1 changed files with 11 additions and 4 deletions
|
@ -67,19 +67,26 @@ const DueDateEditStep = React.memo(({ defaultValue, onUpdate, onBack, onClose })
|
|||
return;
|
||||
}
|
||||
|
||||
const value = parseTime(data.time, nullableDate);
|
||||
let value = t('format:dateTime', {
|
||||
postProcess: 'parseDate',
|
||||
value: `${data.date} ${data.time}`,
|
||||
});
|
||||
|
||||
if (Number.isNaN(value.getTime())) {
|
||||
value = parseTime(data.time, nullableDate);
|
||||
|
||||
if (Number.isNaN(value.getTime())) {
|
||||
timeField.current.select();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!defaultValue || value.getTime() !== defaultValue.getTime()) {
|
||||
onUpdate(value);
|
||||
}
|
||||
|
||||
onClose();
|
||||
}, [defaultValue, onUpdate, onClose, data, nullableDate]);
|
||||
}, [defaultValue, onUpdate, onClose, data, nullableDate, t]);
|
||||
|
||||
const handleClearClick = useCallback(() => {
|
||||
if (defaultValue) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue