mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 17:03:32 +03:00
parent
7e53cd9af1
commit
50aefd6746
@ -11,7 +11,7 @@ export type Rfc3339DateTime = newtype.Newtype<string, 'Rfc3339DateTime'>
|
|||||||
/** Formats date time into the preferred format: `YYYY-MM-DD, hh:mm`. */
|
/** Formats date time into the preferred format: `YYYY-MM-DD, hh:mm`. */
|
||||||
export function formatDateTime(date: Date) {
|
export function formatDateTime(date: Date) {
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
const month = date.getMonth().toString().padStart(2, '0')
|
const month = (date.getMonth() + 1).toString().padStart(2, '0')
|
||||||
const dayOfMonth = date.getDate().toString().padStart(2, '0')
|
const dayOfMonth = date.getDate().toString().padStart(2, '0')
|
||||||
const hour = date.getHours().toString().padStart(2, '0')
|
const hour = date.getHours().toString().padStart(2, '0')
|
||||||
const minute = date.getMinutes().toString().padStart(2, '0')
|
const minute = date.getMinutes().toString().padStart(2, '0')
|
||||||
|
Loading…
Reference in New Issue
Block a user