mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-19 21:04:33 +08:00
🐛 Fix date input label computation
This commit is contained in:
parent
9b5426ce18
commit
13d6679308
@ -17,10 +17,11 @@ export const parseReadableDate = ({
|
||||
hour: hasTime ? '2-digit' : undefined,
|
||||
minute: hasTime ? '2-digit' : undefined,
|
||||
}
|
||||
const fromReadable = new Date(from).toLocaleString(
|
||||
currentLocale,
|
||||
formatOptions
|
||||
)
|
||||
const toReadable = new Date(to).toLocaleString(currentLocale, formatOptions)
|
||||
const fromReadable = new Date(
|
||||
from.replace(/-/g, '/').replace(/T.+/, '')
|
||||
).toLocaleString(currentLocale, formatOptions)
|
||||
const toReadable = new Date(
|
||||
to.replace(/-/g, '/').replace(/T.+/, '')
|
||||
).toLocaleString(currentLocale, formatOptions)
|
||||
return `${fromReadable}${isRange ? ` to ${toReadable}` : ''}`
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user