ical-generator 7.0.1-develop.2 → 7.1.0-develop.2
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 +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/event.ts +2 -2
- package/src/tools.ts +8 -2
- package/src/types.ts +1 -0
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"esm": "^3.2.25",
|
|
26
26
|
"license-checker": "^25.0.1",
|
|
27
27
|
"luxon": "^3.4.4",
|
|
28
|
-
"mocha": "^10.
|
|
28
|
+
"mocha": "^10.4.0",
|
|
29
29
|
"mochawesome": "^7.1.3",
|
|
30
30
|
"moment": "^2.30.1",
|
|
31
31
|
"moment-timezone": "^0.5.45",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"ts-node": "^10.9.2",
|
|
38
38
|
"tsup": "^8.0.2",
|
|
39
39
|
"typedoc": "^0.25.12",
|
|
40
|
-
"typescript": "^5.4.
|
|
40
|
+
"typescript": "^5.4.3"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
43
|
"node": ">=18.0.0"
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"test": "mocha"
|
|
126
126
|
},
|
|
127
127
|
"type": "module",
|
|
128
|
-
"version": "7.0
|
|
128
|
+
"version": "7.1.0-develop.2"
|
|
129
129
|
}
|
package/src/event.ts
CHANGED
|
@@ -1666,9 +1666,9 @@ export default class ICalEvent {
|
|
|
1666
1666
|
this.swapStartAndEndIfRequired();
|
|
1667
1667
|
g += 'DTSTAMP:' + formatDate(this.calendar.timezone(), this.data.stamp) + '\r\n';
|
|
1668
1668
|
if (this.data.allDay) {
|
|
1669
|
-
g += 'DTSTART;VALUE=DATE:' + formatDate(this.
|
|
1669
|
+
g += 'DTSTART;VALUE=DATE:' + formatDate(this.timezone(), this.data.start, true) + '\r\n';
|
|
1670
1670
|
if (this.data.end) {
|
|
1671
|
-
g += 'DTEND;VALUE=DATE:' + formatDate(this.
|
|
1671
|
+
g += 'DTEND;VALUE=DATE:' + formatDate(this.timezone(), this.data.end, true) + '\r\n';
|
|
1672
1672
|
}
|
|
1673
1673
|
|
|
1674
1674
|
g += 'X-MICROSOFT-CDO-ALLDAYEVENT:TRUE\r\n';
|
package/src/tools.ts
CHANGED
|
@@ -54,13 +54,19 @@ export function formatDate (timezone: string | null, d: ICalDateTimeValue, dateo
|
|
|
54
54
|
}
|
|
55
55
|
else if(isMoment(d)) {
|
|
56
56
|
// @see https://momentjs.com/timezone/docs/#/using-timezones/parsing-in-zone/
|
|
57
|
-
const m = timezone
|
|
57
|
+
const m = timezone
|
|
58
|
+
? (isMomentTZ(d) && !d.tz() ? d.clone().tz(timezone) : d)
|
|
59
|
+
: (floating || (dateonly && isMomentTZ(d) && d.tz()) ? d : d.utc());
|
|
60
|
+
|
|
58
61
|
return m.format('YYYYMMDD') + (!dateonly ? (
|
|
59
62
|
'T' + m.format('HHmmss') + (floating || timezone ? '' : 'Z')
|
|
60
63
|
) : '');
|
|
61
64
|
}
|
|
62
65
|
else if(isLuxonDate(d)) {
|
|
63
|
-
const m = timezone
|
|
66
|
+
const m = timezone
|
|
67
|
+
? d.setZone(timezone)
|
|
68
|
+
: (floating || (dateonly && d.zone.type !== 'system') ? d : d.setZone('utc'));
|
|
69
|
+
|
|
64
70
|
return m.toFormat('yyyyLLdd') + (!dateonly ? (
|
|
65
71
|
'T' + m.toFormat('HHmmss') + (floating || timezone ? '' : 'Z')
|
|
66
72
|
) : '');
|
package/src/types.ts
CHANGED