Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
MAT-7679 prevent invalid date
Browse files Browse the repository at this point in the history
  • Loading branch information
sb-cecilialiu committed Nov 8, 2024
1 parent 1d62423 commit 9b2ae98
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ const DateTimeComponent = ({
};

const handleDateTimeChange = (date, time, offset) => {
const dateTime = dayjs(date + "T" + time + ".000");
const dateTimeStr = dateTime.format(DATE_TIME_ZONE_FORMAT).slice(0, 23);
return dateTimeStr + offset;
if (date) {
const dateTime = dayjs(date + "T" + time + ".000");
const dateTimeStr = dateTime.format(DATE_TIME_ZONE_FORMAT).slice(0, 23);
return dateTimeStr + offset;
}
return null;
};

return (
Expand Down

0 comments on commit 9b2ae98

Please sign in to comment.