-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
export const formatIsoLocaleString = (date: Date): string => {
const tzo = -date.getTimezoneOffset()
const dif = tzo >= 0 ? '+' : '-'
const pad = (num: number): string => {
const norm = Math.floor(Math.abs(num))
return (norm < 10 ? '0' : '') + norm
}
return date.getFullYear() +
'-' + pad(date.getMonth() + 1) +
'-' + pad(date.getDate()) +
'T' + pad(date.getHours()) +
':' + pad(date.getMinutes()) +
':' + pad(date.getSeconds()) +
dif + pad(tzo / 60) +
':' + pad(tzo % 60)
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request