接入前端P0页面真实接口
This commit is contained in:
18
client/src/utils/reservationFormat.ts
Normal file
18
client/src/utils/reservationFormat.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export function formatReservationDateTime(value: string | null | undefined): string {
|
||||
if (!value) {
|
||||
return '-'
|
||||
}
|
||||
return value.replace('T', ' ').replace(/\+.*$/, '')
|
||||
}
|
||||
|
||||
export function formatReservationDateRange(arrivalDate: string, departureDate: string): string {
|
||||
return `${arrivalDate} / ${departureDate}`
|
||||
}
|
||||
|
||||
export function formatReservationCurrency(amount: number, currencyCode: string): string {
|
||||
return new Intl.NumberFormat('zh-CN', {
|
||||
style: 'currency',
|
||||
currency: currencyCode,
|
||||
maximumFractionDigits: 0,
|
||||
}).format(amount)
|
||||
}
|
||||
Reference in New Issue
Block a user