ical-generator 11.1.4-develop.2 → 11.1.4-develop.3

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
@@ -141,5 +141,5 @@
141
141
  "test": "mocha"
142
142
  },
143
143
  "type": "module",
144
- "version": "11.1.4-develop.2"
144
+ "version": "11.1.4-develop.3"
145
145
  }
package/src/event.ts CHANGED
@@ -1007,6 +1007,11 @@ export default class ICalEvent {
1007
1007
  * [readme](https://github.com/sebbo2002/ical-generator#-date-time--timezones)
1008
1008
  * for details about supported values and timezone handling.
1009
1009
  *
1010
+ * For all-day events, the recurrence id is emitted as an RFC 5545 DATE
1011
+ * value (`RECURRENCE-ID;VALUE=DATE:YYYYMMDD`), matching the event's
1012
+ * `DTSTART;VALUE=DATE` format. For timed events, the usual date-time
1013
+ * format is used.
1014
+ *
1010
1015
  * @since 0.2.0
1011
1016
  */
1012
1017
  recurrenceId(recurrenceId: ICalDateTimeValue | null): this;
@@ -1082,6 +1087,45 @@ export default class ICalEvent {
1082
1087
  * END:VCALENDAR
1083
1088
  * ```
1084
1089
  *
1090
+ * For all-day events, the `until` date is emitted as an RFC 5545 DATE value
1091
+ * (`UNTIL=YYYYMMDD` without time), matching the event's `DTSTART;VALUE=DATE`
1092
+ * format:
1093
+ *
1094
+ * ```typescript
1095
+ * import ical, { ICalEventRepeatingFreq } from 'ical-generator';
1096
+ *
1097
+ * const cal = ical();
1098
+ *
1099
+ * const event = cal.createEvent({
1100
+ * allDay: true,
1101
+ * start: new Date('2025-03-10'),
1102
+ * summary: 'Repeating All-Day Event'
1103
+ * });
1104
+ * event.repeating({
1105
+ * freq: ICalEventRepeatingFreq.WEEKLY,
1106
+ * until: new Date('2025-03-24')
1107
+ * });
1108
+ *
1109
+ * cal.toString();
1110
+ * ```
1111
+ *
1112
+ * ```text
1113
+ * BEGIN:VCALENDAR
1114
+ * VERSION:2.0
1115
+ * PRODID:-//sebbo.net//ical-generator//EN
1116
+ * BEGIN:VEVENT
1117
+ * UID:d21d3ff4-73c2-4e12-ae45-fb1baf488292
1118
+ * SEQUENCE:0
1119
+ * DTSTAMP:20261116T171008Z
1120
+ * DTSTART;VALUE=DATE:20250310
1121
+ * X-MICROSOFT-CDO-ALLDAYEVENT:TRUE
1122
+ * X-MICROSOFT-MSNCALENDAR-ALLDAYEVENT:TRUE
1123
+ * RRULE:FREQ=WEEKLY;UNTIL=20250324
1124
+ * SUMMARY:Repeating All-Day Event
1125
+ * END:VEVENT
1126
+ * END:VCALENDAR
1127
+ * ```
1128
+ *
1085
1129
  * @since 0.2.0
1086
1130
  */
1087
1131
  repeating(repeating: ICalRepeatingOptions | null): this;
@@ -1639,14 +1683,24 @@ export default class ICalEvent {
1639
1683
  }
1640
1684
 
1641
1685
  if (this.data.repeating.until) {
1642
- g +=
1643
- ';UNTIL=' +
1644
- formatDate(
1645
- this.calendar.timezone(),
1646
- this.data.repeating.until,
1647
- false,
1648
- this.floating(),
1649
- );
1686
+ if (this.data.allDay) {
1687
+ g +=
1688
+ ';UNTIL=' +
1689
+ formatDate(
1690
+ this.timezone(),
1691
+ this.data.repeating.until,
1692
+ true,
1693
+ );
1694
+ } else {
1695
+ g +=
1696
+ ';UNTIL=' +
1697
+ formatDate(
1698
+ this.calendar.timezone(),
1699
+ this.data.repeating.until,
1700
+ false,
1701
+ this.floating(),
1702
+ );
1703
+ }
1650
1704
  }
1651
1705
 
1652
1706
  if (this.data.repeating.byDay) {
@@ -1727,13 +1781,20 @@ export default class ICalEvent {
1727
1781
 
1728
1782
  // RECURRENCE
1729
1783
  if (this.data.recurrenceId) {
1730
- g +=
1731
- formatDateTZ(
1732
- this.timezone(),
1733
- 'RECURRENCE-ID',
1734
- this.data.recurrenceId,
1735
- this.data,
1736
- ) + '\r\n';
1784
+ if (this.data.allDay) {
1785
+ g +=
1786
+ 'RECURRENCE-ID;VALUE=DATE:' +
1787
+ formatDate(this.timezone(), this.data.recurrenceId, true) +
1788
+ '\r\n';
1789
+ } else {
1790
+ g +=
1791
+ formatDateTZ(
1792
+ this.timezone(),
1793
+ 'RECURRENCE-ID',
1794
+ this.data.recurrenceId,
1795
+ this.data,
1796
+ ) + '\r\n';
1797
+ }
1737
1798
  }
1738
1799
 
1739
1800
  // SUMMARY