diff options
author | Ondřej Žára <ondras@zarovi.cz> | 2020-03-31 12:34:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-31 12:34:13 +0200 |
commit | a86b07f2df20b6436291d77d9636061ede0b6c8e (patch) | |
tree | 1cc201a0a84c0cf0ee916256690ddd581ec11f6b /std/datetime/mod.ts | |
parent | bdcb926b37d9ac79b58c66b418a9c37fa746eeb7 (diff) |
used native padStart/End where possible (#4537)
Diffstat (limited to 'std/datetime/mod.ts')
-rw-r--r-- | std/datetime/mod.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/std/datetime/mod.ts b/std/datetime/mod.ts index 036cd2cc5..258388397 100644 --- a/std/datetime/mod.ts +++ b/std/datetime/mod.ts @@ -1,5 +1,4 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { pad } from "../strings/pad.ts"; import { assert } from "../testing/asserts.ts"; export type DateFormat = "mm-dd-yyyy" | "dd-mm-yyyy" | "yyyy-mm-dd"; @@ -125,7 +124,7 @@ export function currentDayOfYear(): number { */ export function toIMF(date: Date): string { function dtPad(v: string, lPad = 2): string { - return pad(v, lPad, { char: "0" }); + return v.padStart(lPad, "0"); } const d = dtPad(date.getUTCDate().toString()); const h = dtPad(date.getUTCHours().toString()); |