Merge pull request #25468 from overleaf/ii-flexible-licensing-invoice-date

[web] FL next invoice date formatting

GitOrigin-RevId: 5f4f86d4f11c7ee217ff806d26fc3f8a79e5affc
This commit is contained in:
ilkin-overleaf
2025-05-13 13:05:26 +03:00
committed by Copybot
parent 6d35305d7d
commit 21c035b8d5
3 changed files with 14 additions and 4 deletions

View File

@@ -156,7 +156,8 @@ function CostSummary({ subscriptionChange, totalLicenses }: CostSummaryProps) {
),
date: formatTime(
subscriptionChange.nextInvoice.date,
'MMMM D'
'MMMM D',
true
),
}
)}

View File

@@ -100,7 +100,11 @@ function UpgradeSummary({ subscriptionChange }: UpgradeSummaryProps) {
subscriptionChange.nextInvoice.tax.amount,
subscriptionChange.currency
),
date: formatTime(subscriptionChange.nextInvoice.date, 'MMMM D'),
date: formatTime(
subscriptionChange.nextInvoice.date,
'MMMM D',
true
),
}
)}
{subscriptionChange.immediateCharge.discount !== 0 &&

View File

@@ -11,8 +11,13 @@ moment.updateLocale('en', {
},
})
export function formatTime(date: moment.MomentInput, format = 'h:mm a') {
return moment(date).format(format)
export function formatTime(
date: moment.MomentInput,
format = 'h:mm a',
utc = false
) {
const momentDate = utc ? moment.utc(date) : moment(date)
return momentDate.format(format)
}
export function relativeDate(date: moment.MomentInput) {