ical-generator 10.1.0 → 10.1.1-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/tools.ts +5 -5
package/package.json
CHANGED
package/src/tools.ts
CHANGED
|
@@ -268,14 +268,14 @@ export function formatDate(
|
|
|
268
268
|
|
|
269
269
|
// (!dateonly && !floating) || !timezone => utc
|
|
270
270
|
let s =
|
|
271
|
-
m.getUTCFullYear() +
|
|
271
|
+
m.getUTCFullYear().toString().padStart(4, '0') +
|
|
272
272
|
String(m.getUTCMonth() + 1).padStart(2, '0') +
|
|
273
273
|
m.getUTCDate().toString().padStart(2, '0');
|
|
274
274
|
|
|
275
275
|
// (dateonly || floating) && timezone => tz
|
|
276
276
|
if (timezone) {
|
|
277
277
|
s =
|
|
278
|
-
m.getFullYear() +
|
|
278
|
+
m.getFullYear().toString().padStart(2, '0') +
|
|
279
279
|
String(m.getMonth() + 1).padStart(2, '0') +
|
|
280
280
|
m.getDate().toString().padStart(2, '0');
|
|
281
281
|
}
|
|
@@ -355,7 +355,7 @@ export function formatDate(
|
|
|
355
355
|
// Temporal.PlainDateTime - floating time or convert to timezone
|
|
356
356
|
if (dateonly) {
|
|
357
357
|
return (
|
|
358
|
-
d.year +
|
|
358
|
+
d.year.toString().padStart(4, '0') +
|
|
359
359
|
d.month.toString().padStart(2, '0') +
|
|
360
360
|
d.day.toString().padStart(2, '0')
|
|
361
361
|
);
|
|
@@ -369,7 +369,7 @@ export function formatDate(
|
|
|
369
369
|
|
|
370
370
|
// Floating time - no timezone, no Z
|
|
371
371
|
return (
|
|
372
|
-
d.year +
|
|
372
|
+
d.year.toString().padStart(4, '0') +
|
|
373
373
|
d.month.toString().padStart(2, '0') +
|
|
374
374
|
d.day.toString().padStart(2, '0') +
|
|
375
375
|
'T' +
|
|
@@ -381,7 +381,7 @@ export function formatDate(
|
|
|
381
381
|
} else if (isTemporalPlainDate(d)) {
|
|
382
382
|
// Temporal.PlainDate - date only
|
|
383
383
|
return (
|
|
384
|
-
d.year +
|
|
384
|
+
d.year.toString().padStart(4, '0') +
|
|
385
385
|
d.month.toString().padStart(2, '0') +
|
|
386
386
|
d.day.toString().padStart(2, '0') +
|
|
387
387
|
(!dateonly ? 'T000000' + (floating || timezone ? '' : 'Z') : '')
|