Extract HH:mm

This commit is contained in:
Adria Navarro 2024-05-23 13:00:50 +02:00
parent 9b3f467a52
commit ac92aaeab3
1 changed files with 2 additions and 1 deletions

View File

@ -170,7 +170,8 @@ export const stringifyDate = (
const offset = referenceDate.getTimezoneOffset() * 60000
const date = new Date(value.valueOf() - offset)
if (timeOnly) {
return date.toISOString().slice(11, 19)
// Extract HH:mm
return date.toISOString().slice(11, 16)
}
return date.toISOString().slice(0, -1)
}