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:
Michał Droń 2022-08-02 14:31:17 +02:00 committed by GitHub
parent f9edc55a20
commit 40bdf1ecb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
});
}}
/>