Comparing version 2.0.31 to 2.0.32
@@ -12,2 +12,3 @@ import { Date } from "./Date"; | ||
function create(value: globalThis.Date): DateTime; | ||
function fixIncorrect(value: DateTime | string): DateTime; | ||
/** | ||
@@ -14,0 +15,0 @@ * Return local time with offset. |
@@ -79,5 +79,13 @@ "use strict"; | ||
} | ||
return value.toISOString(); | ||
return fixIncorrect(value.toISOString()); | ||
} | ||
DateTime.create = create; | ||
function fixIncorrect(value) { | ||
if (value.length == 22 && value.match(/\.\dZ$/)) | ||
value = value.substring(0, 21) + "00Z"; | ||
else if (value.length == 23 && value.match(/\.\d\dZ$/)) | ||
value = value.substring(0, 22) + "0Z"; | ||
return value; | ||
} | ||
DateTime.fixIncorrect = fixIncorrect; | ||
/** | ||
@@ -84,0 +92,0 @@ * Return local time with offset. |
@@ -12,2 +12,3 @@ import { Date } from "./Date"; | ||
function create(value: globalThis.Date): DateTime; | ||
function fixIncorrect(value: DateTime | string): DateTime; | ||
/** | ||
@@ -14,0 +15,0 @@ * Return local time with offset. |
@@ -76,5 +76,13 @@ import { Date } from "./Date"; | ||
} | ||
return value.toISOString(); | ||
return fixIncorrect(value.toISOString()); | ||
} | ||
DateTime.create = create; | ||
function fixIncorrect(value) { | ||
if (value.length == 22 && value.match(/\.\dZ$/)) | ||
value = value.substring(0, 21) + "00Z"; | ||
else if (value.length == 23 && value.match(/\.\d\dZ$/)) | ||
value = value.substring(0, 22) + "0Z"; | ||
return value; | ||
} | ||
DateTime.fixIncorrect = fixIncorrect; | ||
/** | ||
@@ -81,0 +89,0 @@ * Return local time with offset. |
{ | ||
"name": "isoly", | ||
"version": "2.0.31", | ||
"version": "2.0.32", | ||
"description": "Datatypes and functions specified by ISO-standards.", | ||
@@ -5,0 +5,0 @@ "author": "Utily Contributors", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1852724
38286