From f8f11277a927152b7d6d61710a654b54ceacd2b3 Mon Sep 17 00:00:00 2001 From: Dan Rivett Date: Fri, 19 Mar 2021 16:51:27 -0700 Subject: [PATCH] Adding in support for generating an ISO8601 datetime string that includes milliseconds - e.g. calls Date.toISOString() as currently the 'iso' format leaves that off which makes it unsuitable for certain use cases. For backwards compatibility this commit adds this in if a new 'isoSS' format is specified. --- src/extension.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index 8097e33..6828d49 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -14,6 +14,9 @@ function getConfiguredFormat(format = "format"): string { function getFormattedDateString(userFormat = getConfiguredFormat()): string { const now = new Date(); + if (userFormat === "isoSS") { + return now.toISOString(); + } return now.format(userFormat); }