From dde733ba3fd582e7eb3f69bf6ec2219c31dcb325 Mon Sep 17 00:00:00 2001 From: darkbizarre Date: Wed, 7 Dec 2016 12:16:19 +0300 Subject: [PATCH 1/3] Update uuid --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3fad6e69..957bbb73 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,6 @@ "dependencies": { "lodash": "^4.16.4", "moment-timezone": "^0.5.6", - "node-uuid": "^1.4.7" + "uuid": "^3.0.0" } } From 4b53a61fd6d9cb1826558e19cabb4130191ad737 Mon Sep 17 00:00:00 2001 From: darkbizarre Date: Wed, 7 Dec 2016 12:17:52 +0300 Subject: [PATCH 2/3] Format datetime to utc datetime --- lib/ics.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ics.js b/lib/ics.js index 15b74491..bb7b1fde 100644 --- a/lib/ics.js +++ b/lib/ics.js @@ -3,7 +3,7 @@ var fs = require('fs'); var _ = require('lodash'); var moment = require('moment-timezone'); -var uuid = require('node-uuid'); +var uuid = require('uuid'); var DEFAULTS = { filename: 'event' @@ -81,7 +81,7 @@ function buildEvent(attributes) { } if (isDateTime(string) && moment.parseZone(string).utcOffset() === 0) { - return 'DTSTART:' + moment(string).format('YYYYMMDDTHHmm00'); + return 'DTSTART:' + moment.utc(string).format('YYYYMMDDTHHmm00') + 'Z'; } if (isDateTime(string)) { @@ -114,7 +114,7 @@ function buildEvent(attributes) { } if (endString && isDateTime(startString)) { - return 'DTEND:' + moment(endString).format('YYYYMMDDTHHmm00'); + return 'DTEND:' + moment.utc(endString).format('YYYYMMDDTHHmm00') + 'Z'; } if (!endString && !isDateTime(startString)) { @@ -122,7 +122,7 @@ function buildEvent(attributes) { } if (!endString && isDateTime(startString) && moment.parseZone(startString).utcOffset() === 0) { - return 'DTEND:' + moment(startString).format('YYYYMMDDTHHmm00'); + return 'DTEND:' + moment.utc(startString).format('YYYYMMDDTHHmm00') + 'Z'; } } @@ -245,4 +245,4 @@ ICS.prototype.createEvent = function(attributes, _options_, cb) { }); }; -module.exports = ICS; \ No newline at end of file +module.exports = ICS; From bfedfc9eff5af19b934a9b14e28e309b39e872e2 Mon Sep 17 00:00:00 2001 From: darkbizarre Date: Wed, 7 Dec 2016 12:20:11 +0300 Subject: [PATCH 3/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1c4e323..499e09bc 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The [iCalendar](http://tools.ietf.org/html/rfc5545) generator ## Install -`npm install -S ics` +`npm install -S darkbizarre/ics` ## Example Usage @@ -114,4 +114,4 @@ values resolve to `/Users/gibber/my-event.ics` when executed from `/Users/gibber ## References - [RFC 5545: Internet Calendaring and Scheduling Core Object Specification (iCalendar)](http://tools.ietf.org/html/rfc5545) -- [iCalendar Validator](http://icalendar.org/validator.html#results) \ No newline at end of file +- [iCalendar Validator](http://icalendar.org/validator.html#results)