Socket
Socket
Sign inDemoInstall

cozy-ical

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cozy-ical - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

2

lib/alarm.js

@@ -33,3 +33,3 @@ // Generated by CoffeeScript 1.8.0

uid: this.id,
stampDate: moment.tz(moment(), 'UTC'),
stampDate: moment().tz('UTC').toDate(),
summary: this.description

@@ -36,0 +36,0 @@ });

@@ -12,3 +12,3 @@ // Generated by CoffeeScript 1.8.0

Event.prototype.toIcal = function() {
var allDay, e, event, mappedAttendees, rrule, timezone, _ref1, _ref2;
var allDay, created, e, event, lastModification, mappedAttendees, rrule, stampDate, timezone, _ref1, _ref2;
allDay = this.start.length === 10;

@@ -31,5 +31,9 @@ timezone = 'UTC';

}) : void 0;
created = this.created || null;
lastModification = this.lastModification || null;
stampDate = this.lastModification || moment().tz('UTC');
stampDate = moment.tz(stampDate, 'UTC').toDate();
try {
event = new VEvent({
stampDate: moment.tz(moment(), 'UTC'),
stampDate: stampDate,
startDate: moment.tz(this.start, timezone),

@@ -44,3 +48,5 @@ endDate: moment.tz(this.end, timezone),

attendees: mappedAttendees,
timezone: this.timezone
timezone: this.timezone,
created: created,
lastModification: lastModification
});

@@ -86,3 +92,3 @@ } catch (_error) {

Event.fromIcal = function(vevent, defaultCalendar) {
var alarms, defaultCozyStatus, end, event, model, start, timezone, _ref1;
var alarms, defaultCozyStatus, end, event, model, now, stampDate, start, timezone, _ref1;
if (defaultCalendar == null) {

@@ -93,2 +99,3 @@ defaultCalendar = 'my calendar';

model = vevent.model;
now = moment().tz('UTC').toISOString();
timezone = model.timezone || 'UTC';

@@ -119,2 +126,7 @@ if (model.uid != null) {

}) : void 0;
if (model.created != null) {
event.created = model.created;
}
stampDate = moment.tz(model.stampDate, 'UTC').toISOString();
event.lastModification = model.lastModification || stampDate || now;
if (model.allDay) {

@@ -121,0 +133,0 @@ event.start = moment.tz(model.startDate, 'UTC').format(Event.dateFormat);

@@ -429,3 +429,3 @@ // Generated by CoffeeScript 1.8.0

VTodo.__super__.build.call(this);
stampDate = moment(this.model.stampDate);
stampDate = moment.tz(this.model.stampDate, 'UTC');
this.addRawField('UID', this.model.uid);

@@ -447,3 +447,3 @@ this.addRawField('DTSTAMP', stampDate.format(VEvent.icalDTUTCFormat));

VTodo.__super__.extract.call(this);
stampDate = ((_ref1 = this.getRawField('DTSTAMP')) != null ? _ref1.value : void 0) || moment();
stampDate = ((_ref1 = this.getRawField('DTSTAMP')) != null ? _ref1.value : void 0) || moment().tz('UTC');
startDate = (_ref2 = this.getRawField('DTSTART')) != null ? _ref2.value : void 0;

@@ -471,3 +471,3 @@ due = (_ref3 = this.getRawField('DUE')) != null ? _ref3.value : void 0;

uid: ((_ref6 = this.getRawField('UID')) != null ? _ref6.value : void 0) || uuid.v1(),
stampDate: moment(stampDate).toDate(),
stampDate: moment.tz(stampDate, VTodo.icalDTUTCFormat, 'UTC').toDate(),
description: ((_ref7 = this.getRawField('DESCRIPTION')) != null ? _ref7.value : void 0) || '',

@@ -515,3 +515,3 @@ startDate: startDate.toDate(),

VEvent.prototype.build = function() {
var attendee, details, fieldEnd, fieldStart, formatEnd, formatStart, name, rrule, stampDate, status, timezoneEnd, timezoneStart, _i, _len, _ref1, _ref2, _ref3;
var attendee, created, details, fieldEnd, fieldStart, formatEnd, formatStart, lastModification, name, rrule, stampDate, status, timezoneEnd, timezoneStart, _i, _len, _ref1, _ref2, _ref3;
VEvent.__super__.build.call(this);

@@ -563,3 +563,3 @@ if ((this.model.endDate == null) && (this.model.duration == null) && (this.model.rrule == null)) {

}
stampDate = moment(this.model.stampDate);
stampDate = moment(this.model.stampDate).tz('UTC');
this.addRawField('UID', this.model.uid);

@@ -582,5 +582,13 @@ this.addRawField('DTSTAMP', stampDate.format(VEvent.icalDTUTCFormat));

}
if (this.model.lastModification != null) {
lastModification = moment.tz(this.model.lastModification, 'UTC').format(VEvent.icalDTUTCFormat);
}
if (this.model.created != null) {
created = moment.tz(this.model.created, 'UTC').format(VEvent.icalDTUTCFormat);
}
this.addRawField('CATEGORIES', this.model.categories || null);
this.addRawField('CREATED', created || null);
this.addRawField('DESCRIPTION', this.model.description || null);
this.addRawField('DURATION', this.model.duration || null);
this.addRawField('LAST-MOD', lastModification || null);
this.addRawField('LOCATION', this.model.location || null);

@@ -593,3 +601,4 @@ this.addRawField('ORGANIZER', this.model.organizer || null);

VEvent.prototype.extract = function() {
var UTCFormat, allDay, attendees, daysNum, dtend, dtstart, duration, endDate, hoursNum, iCalFormat, minutesNum, rrule, rruleOptions, secondsNum, stampDate, startDate, timezone, timezoneEnd, timezoneStart, uid, weeksNum, _, _ref1, _ref10, _ref11, _ref12, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
var allDay, attendees, created, daysNum, dtend, dtstart, duration, endDate, hoursNum, iCalFormat, lastModification, minutesNum, rrule, rruleOptions, secondsNum, stampDate, startDate, timezone, timezoneEnd, timezoneStart, uid, weeksNum, _, _ref1, _ref10, _ref11, _ref12, _ref13, _ref14, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
iCalFormat = 'YYYYMMDDTHHmmss';
uid = this.getRawField('UID');

@@ -620,4 +629,2 @@ stampDate = ((_ref1 = this.getRawField('DTSTAMP')) != null ? _ref1.value : void 0) || moment();

duration = ((_ref4 = this.getRawField('DURATION')) != null ? _ref4.value : void 0) || null;
UTCFormat = 'YYYYMMDDTHHmmss[Z]';
iCalFormat = 'YYYYMMDDTHHmmss';
if ((endDate != null) && (duration != null)) {

@@ -682,5 +689,13 @@ duration = null;

}) : void 0;
lastModification = (_ref8 = this.getRawField('LAST-MOD')) != null ? _ref8.value : void 0;
if (lastModification != null) {
lastModification = moment.tz(lastModification, VEvent.icalDTUTCFormat, 'UTC').toISOString();
}
created = (_ref9 = this.getRawField('CREATED')) != null ? _ref9.value : void 0;
if (created != null) {
created = moment.tz(created, VEvent.icalDTUTCFormat, 'UTC').toISOString();
}
return this.model = {
uid: (uid != null ? uid.value : void 0) || uuid.v1(),
stampDate: moment.tz(stampDate, UTCFormat, 'UTC').toDate(),
stampDate: moment.tz(stampDate, VEvent.icalDTUTCFormat, 'UTC').toDate(),
startDate: moment.tz(startDate, iCalFormat, timezoneStart).toDate(),

@@ -690,10 +705,12 @@ endDate: endDate,

attendees: attendees,
categories: ((_ref8 = this.getRawField('CATEGORIES')) != null ? _ref8.value : void 0) || null,
description: ((_ref9 = this.getRawField('DESCRIPTION')) != null ? _ref9.value : void 0) || null,
location: ((_ref10 = this.getRawField('LOCATION')) != null ? _ref10.value : void 0) || null,
organizer: ((_ref11 = this.getRawField('ORGANIZER')) != null ? _ref11.value : void 0) || null,
categories: ((_ref10 = this.getRawField('CATEGORIES')) != null ? _ref10.value : void 0) || null,
description: ((_ref11 = this.getRawField('DESCRIPTION')) != null ? _ref11.value : void 0) || null,
location: ((_ref12 = this.getRawField('LOCATION')) != null ? _ref12.value : void 0) || null,
organizer: ((_ref13 = this.getRawField('ORGANIZER')) != null ? _ref13.value : void 0) || null,
rrule: rruleOptions || null,
summary: ((_ref12 = this.getRawField('SUMMARY')) != null ? _ref12.value : void 0) || null,
summary: ((_ref14 = this.getRawField('SUMMARY')) != null ? _ref14.value : void 0) || null,
allDay: allDay || null,
timezone: timezone || null
timezone: timezone || null,
lastModification: lastModification || null,
created: created || null
};

@@ -700,0 +717,0 @@ };

{
"name": "cozy-ical",
"version": "1.0.8",
"version": "1.0.9",
"description": "Cozy-Ical provides ICal Parser, generators and helpers",

@@ -5,0 +5,0 @@ "main": "lib/index",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc