@event-calendar/common
Advanced tools
Comparing version 0.0.1-alpha.3 to 0.0.1-alpha.4
14
index.js
@@ -6,5 +6,17 @@ import { is_function } from 'svelte/internal'; | ||
function fromISOString(str) { | ||
const parts = str.match(/\d+/g); | ||
return new Date( | ||
Number(parts[0]), | ||
Number(parts[1]) - 1, | ||
Number(parts[2]), | ||
Number(parts[3] || 0), | ||
Number(parts[4] || 0), | ||
Number(parts[5] || 0) | ||
); | ||
} | ||
function createDate(input) { | ||
return input !== undefined | ||
? (input instanceof Date ? cloneDate(input) : new Date(input.replace(' ', 'T'))) // ie11 needs "T" for time | ||
? (input instanceof Date ? cloneDate(input) : fromISOString(input)) | ||
: new Date(); | ||
@@ -11,0 +23,0 @@ } |
{ | ||
"name": "@event-calendar/common", | ||
"version": "0.0.1-alpha.3", | ||
"version": "0.0.1-alpha.4", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "exports": { |
11109
332