Fix date format in mutations (#2207)
* Fix date format in mutations * Change date format to UTC * Change template literal to sliced isostring
This commit is contained in:
parent
f9edc55a20
commit
40bdf1ecb8
1 changed files with 3 additions and 2 deletions
|
@ -54,7 +54,8 @@ const ChannelContent: React.FC<ChannelContentProps> = ({
|
|||
const intl = useIntl();
|
||||
const classes = useStyles({});
|
||||
|
||||
const todayDate = localizeDate(new Date(dateNow).toISOString());
|
||||
const parsedDate = new Date(dateNow);
|
||||
const todayDateUTC = parsedDate.toISOString().slice(0, 10);
|
||||
|
||||
const visibleMessage = (date: string) =>
|
||||
intl.formatMessage(
|
||||
|
@ -111,7 +112,7 @@ const ChannelContent: React.FC<ChannelContentProps> = ({
|
|||
...formData,
|
||||
isPublished: !isPublished,
|
||||
publicationDate:
|
||||
!isPublished && !publicationDate ? todayDate : publicationDate,
|
||||
!isPublished && !publicationDate ? todayDateUTC : publicationDate,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue