ical-generator 7.0.1-develop.1 → 7.1.0-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/package.json CHANGED
@@ -12,16 +12,16 @@
12
12
  "@semantic-release/changelog": "^6.0.3",
13
13
  "@semantic-release/exec": "^6.0.3",
14
14
  "@semantic-release/git": "^10.0.1",
15
- "@semantic-release/npm": "^11.0.3",
15
+ "@semantic-release/npm": "^12.0.0",
16
16
  "@touch4it/ical-timezones": "^1.9.0",
17
17
  "@types/luxon": "^3.4.2",
18
18
  "@types/mocha": "^10.0.6",
19
- "@typescript-eslint/eslint-plugin": "^7.1.0",
20
- "@typescript-eslint/parser": "^7.1.0",
19
+ "@typescript-eslint/eslint-plugin": "^7.3.1",
20
+ "@typescript-eslint/parser": "^7.3.1",
21
21
  "c8": "^9.1.0",
22
22
  "dayjs": "^1.11.10",
23
23
  "eslint": "^8.57.0",
24
- "eslint-plugin-jsonc": "^2.13.0",
24
+ "eslint-plugin-jsonc": "^2.14.0",
25
25
  "esm": "^3.2.25",
26
26
  "license-checker": "^25.0.1",
27
27
  "luxon": "^3.4.4",
@@ -31,7 +31,7 @@
31
31
  "moment-timezone": "^0.5.45",
32
32
  "nyc": "^15.1.0",
33
33
  "rrule": "^2.8.1",
34
- "semantic-release": "^23.0.2",
34
+ "semantic-release": "^23.0.5",
35
35
  "semantic-release-license": "^1.0.2",
36
36
  "source-map-support": "^0.5.21",
37
37
  "ts-node": "^10.9.2",
@@ -125,5 +125,5 @@
125
125
  "test": "mocha"
126
126
  },
127
127
  "type": "module",
128
- "version": "7.0.1-develop.1"
128
+ "version": "7.1.0-develop.1"
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.calendar.timezone(), this.data.start, true) + '\r\n';
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.calendar.timezone(), this.data.end, true) + '\r\n';
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 ? (isMomentTZ(d) && !d.tz() ? d.clone().tz(timezone) : d) : (floating ? d : d.utc());
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 ? d.setZone(timezone) : (floating ? d : d.setZone('utc'));
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
@@ -76,6 +76,7 @@ export interface ICalMomentDurationStub {
76
76
 
77
77
  export interface ICalLuxonDateTimeStub {
78
78
  setZone(zone?: string): ICalLuxonDateTimeStub;
79
+ zone: { type: string; };
79
80
  toFormat(fmt: string): string;
80
81
  toJSDate(): Date;
81
82
  get isValid(): boolean;