🐛 Fix date input label computation
This commit is contained in:
@@ -17,10 +17,11 @@ export const parseReadableDate = ({
|
|||||||
hour: hasTime ? '2-digit' : undefined,
|
hour: hasTime ? '2-digit' : undefined,
|
||||||
minute: hasTime ? '2-digit' : undefined,
|
minute: hasTime ? '2-digit' : undefined,
|
||||||
}
|
}
|
||||||
const fromReadable = new Date(from).toLocaleString(
|
const fromReadable = new Date(
|
||||||
currentLocale,
|
from.replace(/-/g, '/').replace(/T.+/, '')
|
||||||
formatOptions
|
).toLocaleString(currentLocale, formatOptions)
|
||||||
)
|
const toReadable = new Date(
|
||||||
const toReadable = new Date(to).toLocaleString(currentLocale, formatOptions)
|
to.replace(/-/g, '/').replace(/T.+/, '')
|
||||||
|
).toLocaleString(currentLocale, formatOptions)
|
||||||
return `${fromReadable}${isRange ? ` to ${toReadable}` : ''}`
|
return `${fromReadable}${isRange ? ` to ${toReadable}` : ''}`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user