Comparing version 0.0.14 to 0.0.15
@@ -7,3 +7,3 @@ export declare type DateTime = string; | ||
function now(): DateTime; | ||
function localize(value: Date, locale?: string): DateTime; | ||
function localize(value: DateTime | Date, locale?: string): DateTime; | ||
} |
@@ -26,6 +26,6 @@ "use strict"; | ||
const localeOptions = { | ||
year: "numeric", month: "2-digit", day: "2-digit", hour: "numeric", minute: "numeric", second: "numeric", | ||
year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", | ||
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone, | ||
}; | ||
return value.toLocaleDateString(localeString, localeOptions); | ||
return (is(value) ? parse(value) : value).toLocaleString(localeString, localeOptions); | ||
} | ||
@@ -32,0 +32,0 @@ DateTime.localize = localize; |
{ | ||
"name": "isoly", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -61,2 +61,3 @@ "author": "PayFunc", | ||
"ts-jest": "^26.1.0", | ||
"tslint": "^6.1.2", | ||
"typescript": "^3.9.5", | ||
@@ -63,0 +64,0 @@ "typescript-tslint-plugin": "^0.5.5", |
Sorry, the diff of this file is not supported yet
770474
10