Merged in fix/SW-2801-correct-date-formats (pull request #2400)
fix(SW-2801): Added lang specific date formats * fix(SW-2801): Added lang specific date formats * fix: wrong type import Approved-by: Michael Zetterberg
This commit is contained in:
@@ -6,6 +6,7 @@ import { Divider } from "@scandic-hotels/design-system/Divider"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { longDateFormat } from "@/constants/dateFormats"
|
||||
import { dt } from "@/lib/dt"
|
||||
import { useBookingConfirmationStore } from "@/stores/booking-confirmation"
|
||||
|
||||
@@ -50,10 +51,10 @@ export default function Receipt() {
|
||||
</Typography>
|
||||
<Typography variant="Body/Paragraph/mdBold">
|
||||
<p className={styles.dates}>
|
||||
{dt(fromDate).locale(lang).format("ddd, D MMM")}
|
||||
{dt(fromDate).locale(lang).format(longDateFormat[lang])}
|
||||
<MaterialIcon icon="arrow_forward" size={15} color="CurrentColor" />
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
{dt(toDate).locale(lang).format("ddd, D MMM")} ({nights})
|
||||
{dt(toDate).locale(lang).format(longDateFormat[lang])} ({nights})
|
||||
</p>
|
||||
</Typography>
|
||||
</header>
|
||||
|
||||
@@ -6,6 +6,10 @@ import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
import { Typography } from "@scandic-hotels/design-system/Typography"
|
||||
|
||||
import { CancellationRuleEnum } from "@/constants/booking"
|
||||
import {
|
||||
changeOrCancelDateFormat,
|
||||
longDateFormat,
|
||||
} from "@/constants/dateFormats"
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import Image from "@/components/Image"
|
||||
@@ -128,7 +132,7 @@ export default function Room({
|
||||
defaultMessage: "{checkInDate} from {checkInTime}",
|
||||
},
|
||||
{
|
||||
checkInDate: fromDate.format("ddd, D MMM"),
|
||||
checkInDate: fromDate.format(longDateFormat[lang]),
|
||||
checkInTime: checkInTime,
|
||||
}
|
||||
)}
|
||||
@@ -146,7 +150,7 @@ export default function Room({
|
||||
defaultMessage: "{checkOutDate} from {checkOutTime}",
|
||||
},
|
||||
{
|
||||
checkOutDate: toDate.format("ddd, D MMM"),
|
||||
checkOutDate: toDate.format(longDateFormat[lang]),
|
||||
checkOutTime: checkOutTime,
|
||||
}
|
||||
)}
|
||||
@@ -172,7 +176,10 @@ export default function Room({
|
||||
{
|
||||
defaultMessage: "Until {time}, {date}",
|
||||
},
|
||||
{ time: "18:00", date: fromDate.format("dddd D MMM") }
|
||||
{
|
||||
time: "18:00",
|
||||
date: fromDate.format(changeOrCancelDateFormat[lang]),
|
||||
}
|
||||
)}
|
||||
</p>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user