@hebcal/icalendar 4.20.1 → 4.21.0

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.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/icalendar v4.20.1 */
1
+ /*! @hebcal/icalendar v4.21.0 */
2
2
  'use strict';
3
3
 
4
4
  var core = require('@hebcal/core');
@@ -6,7 +6,7 @@ var murmurhash3 = require('murmurhash3');
6
6
  var restApi = require('@hebcal/rest-api');
7
7
  var fs = require('fs');
8
8
 
9
- const version="4.20.1";
9
+ const version="4.21.0";
10
10
 
11
11
  const VTIMEZONE = {};
12
12
  const CATEGORY = {
@@ -71,6 +71,11 @@ class IcalEvent {
71
71
  this.ev = ev;
72
72
  this.options = options;
73
73
  this.dtstamp = options.dtstamp || IcalEvent.makeDtstamp(new Date());
74
+ if (typeof ev.sequence === 'number') {
75
+ this.sequence = ev.sequence;
76
+ } else if (typeof options.sequence === 'number') {
77
+ this.sequence = options.sequence;
78
+ }
74
79
  const timed = this.timed = Boolean(ev.eventTime);
75
80
  const locale = options.locale;
76
81
  let subj = restApi.shouldRenderBrief(ev) ? ev.renderBrief(locale) : ev.render(locale);
@@ -183,8 +188,11 @@ class IcalEvent {
183
188
  */
184
189
  getLongLines() {
185
190
  if (this.lines) return this.lines;
186
- const categoryLine = this.category ? `CATEGORIES:${this.category}` : [];
191
+ const categoryLine = this.category ? [`CATEGORIES:${this.category}`] : [];
187
192
  const uid = this.ev.uid || this.getUid();
193
+ if (this.sequence) {
194
+ categoryLine.unshift(`SEQUENCE:${this.sequence}`);
195
+ }
188
196
  const arr = this.lines = ['BEGIN:VEVENT', `DTSTAMP:${this.dtstamp}`].concat(categoryLine).concat([`SUMMARY:${this.subj}`, `DTSTART${this.dtargs}:${this.startDate}`, `DTEND${this.dtargs}:${this.endDate}`, `UID:${uid}`, `TRANSP:${this.transp}`, `X-MICROSOFT-CDO-BUSYSTATUS:${this.busyStatus}`]);
189
197
  if (!this.timed) {
190
198
  arr.push('X-MICROSOFT-CDO-ALLDAYEVENT:TRUE');
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- /*! @hebcal/icalendar v4.20.1 */
1
+ /*! @hebcal/icalendar v4.21.0 */
2
2
  import { flags, Locale, greg } from '@hebcal/core';
3
3
  import { murmur32HexSync } from 'murmurhash3';
4
4
  import { shouldRenderBrief, pad2, getEventCategories, makeAnchor, pad4, getHolidayDescription, getCalendarTitle, appendIsraelAndTracking, makeTorahMemoText } from '@hebcal/rest-api';
5
5
  import { promises } from 'fs';
6
6
 
7
- const version="4.20.1";
7
+ const version="4.21.0";
8
8
 
9
9
  const VTIMEZONE = {};
10
10
  const CATEGORY = {
@@ -69,6 +69,11 @@ class IcalEvent {
69
69
  this.ev = ev;
70
70
  this.options = options;
71
71
  this.dtstamp = options.dtstamp || IcalEvent.makeDtstamp(new Date());
72
+ if (typeof ev.sequence === 'number') {
73
+ this.sequence = ev.sequence;
74
+ } else if (typeof options.sequence === 'number') {
75
+ this.sequence = options.sequence;
76
+ }
72
77
  const timed = this.timed = Boolean(ev.eventTime);
73
78
  const locale = options.locale;
74
79
  let subj = shouldRenderBrief(ev) ? ev.renderBrief(locale) : ev.render(locale);
@@ -181,8 +186,11 @@ class IcalEvent {
181
186
  */
182
187
  getLongLines() {
183
188
  if (this.lines) return this.lines;
184
- const categoryLine = this.category ? `CATEGORIES:${this.category}` : [];
189
+ const categoryLine = this.category ? [`CATEGORIES:${this.category}`] : [];
185
190
  const uid = this.ev.uid || this.getUid();
191
+ if (this.sequence) {
192
+ categoryLine.unshift(`SEQUENCE:${this.sequence}`);
193
+ }
186
194
  const arr = this.lines = ['BEGIN:VEVENT', `DTSTAMP:${this.dtstamp}`].concat(categoryLine).concat([`SUMMARY:${this.subj}`, `DTSTART${this.dtargs}:${this.startDate}`, `DTEND${this.dtargs}:${this.endDate}`, `UID:${uid}`, `TRANSP:${this.transp}`, `X-MICROSOFT-CDO-BUSYSTATUS:${this.busyStatus}`]);
187
195
  if (!this.timed) {
188
196
  arr.push('X-MICROSOFT-CDO-ALLDAYEVENT:TRUE');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebcal/icalendar",
3
- "version": "4.20.1",
3
+ "version": "4.21.0",
4
4
  "author": "Michael J. Radwin (https://github.com/mjradwin)",
5
5
  "keywords": [
6
6
  "ical",
@@ -54,10 +54,10 @@
54
54
  "@rollup/plugin-commonjs": "^25.0.2",
55
55
  "@rollup/plugin-json": "^6.0.0",
56
56
  "ava": "^5.3.1",
57
- "eslint": "^8.43.0",
57
+ "eslint": "^8.44.0",
58
58
  "eslint-config-google": "^0.14.0",
59
59
  "jsdoc": "^4.0.2",
60
60
  "jsdoc-to-markdown": "^8.0.0",
61
- "rollup": "^3.25.3"
61
+ "rollup": "^3.26.0"
62
62
  }
63
63
  }