Named months (#2130)

* Use named moths to avoid ambiguity

* Change format of gift card expiration
This commit is contained in:
Timur Carpeev 2022-07-15 11:46:59 +02:00 committed by GitHub
parent 7e4c6c8a7e
commit f555e819af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 10 deletions

View file

@ -54,7 +54,7 @@ const ChannelContent: React.FC<ChannelContentProps> = ({
const intl = useIntl(); const intl = useIntl();
const classes = useStyles({}); const classes = useStyles({});
const todayDate = localizeDate(new Date(dateNow).toISOString(), "YYYY-MM-DD"); const todayDate = localizeDate(new Date(dateNow).toISOString());
const visibleMessage = (date: string) => const visibleMessage = (date: string) =>
intl.formatMessage( intl.formatMessage(
@ -64,7 +64,7 @@ const ChannelContent: React.FC<ChannelContentProps> = ({
description: "date", description: "date",
}, },
{ {
date: localizeDate(date, "L"), date: localizeDate(date),
}, },
); );
const formErrors = getFormErrors( const formErrors = getFormErrors(

View file

@ -29,7 +29,7 @@ export const getChannelsAvailabilityMessages = ({
description: "channel publication date", description: "channel publication date",
}, },
{ {
date: localizeDate(currVal.publicationDate, "L"), date: localizeDate(currVal.publicationDate),
}, },
) )
: currVal.publicationDate : currVal.publicationDate
@ -40,7 +40,7 @@ export const getChannelsAvailabilityMessages = ({
description: "channel publication date", description: "channel publication date",
}, },
{ {
date: localizeDate(currVal.publicationDate, "L"), date: localizeDate(currVal.publicationDate),
}, },
) )
: currVal.isPublished : currVal.isPublished
@ -66,7 +66,7 @@ export const getChannelsAvailabilityMessages = ({
description: "product available for purchase date", description: "product available for purchase date",
}, },
{ {
date: localizeDate(currVal.availableForPurchase, "L"), date: localizeDate(currVal.availableForPurchase),
}, },
), ),
hiddenSecondLabel: intl.formatMessage( hiddenSecondLabel: intl.formatMessage(
@ -76,7 +76,7 @@ export const getChannelsAvailabilityMessages = ({
description: "product publication date label", description: "product publication date label",
}, },
{ {
date: localizeDate(currVal.publicationDate, "L"), date: localizeDate(currVal.publicationDate),
}, },
), ),
setAvailabilityDateLabel: intl.formatMessage({ setAvailabilityDateLabel: intl.formatMessage({

View file

@ -115,7 +115,7 @@ export const VisibilityCard: React.FC<VisibilityCardProps> = props => {
description: "date", description: "date",
}, },
{ {
date: localizeDate(date, "L"), date: localizeDate(date),
}, },
); );

View file

@ -125,7 +125,7 @@ const GiftCardCreateExpirySelect: React.FC<GiftCardCreateExpirySelectProps> = ({
currentDate, currentDate,
expiryPeriodType, expiryPeriodType,
expiryPeriodAmount, expiryPeriodAmount,
)?.format("L")} )?.format("ll")}
</Typography> </Typography>
</div> </div>
</div> </div>

View file

@ -115,7 +115,7 @@ const GiftCardUpdateInfoCardContent: React.FC = () => {
return ( return (
<> <>
<Label text={intl.formatMessage(messages.creationLabel)} /> <Label text={intl.formatMessage(messages.creationLabel)} />
<Typography>{localizeDate(created, "DD MMMM YYYY")}</Typography> <Typography>{localizeDate(created)}</Typography>
<CardSpacer /> <CardSpacer />
<Label text={intl.formatMessage(messages.orderNumberLabel)} /> <Label text={intl.formatMessage(messages.orderNumberLabel)} />

View file

@ -230,7 +230,7 @@ const PageDetailsPage: React.FC<PageDetailsPageProps> = ({
description: "page", description: "page",
}, },
{ {
date: localizeDate(data.publicationDate, "L"), date: localizeDate(data.publicationDate),
}, },
), ),
visibleLabel: intl.formatMessage({ visibleLabel: intl.formatMessage({