Skip to content

Commit

Permalink
Merge pull request #18 from sunrise/pe/upgrade-moment
Browse files Browse the repository at this point in the history
Upgrade Moment-timezone
  • Loading branch information
Pierre-Élie Fauché @ Sunrise committed Jun 9, 2015
2 parents 611c290 + b424d6b commit 4760b7b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ENV_VAR = NODE_ENV=test

all: jshint tests vulnerabilities
all: jshint tests outdated vulnerabilities

jshint:
$(ENV_VAR) ./node_modules/.bin/jshint index.js lib/* test/*
Expand All @@ -12,6 +12,9 @@ tests:
$(ENV_VAR) ./node_modules/.bin/mocha --check-leaks --recursive ./test

vulnerabilities:
./node_modules/.bin/nsp audit-package
./node_modules/.bin/nsp audit-package

outdated:
npm outdated --depth 0 --long

.PHONY: all
2 changes: 1 addition & 1 deletion lib/vobject/dateTimeValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = function(dateTimeString) {
else {
// Absolute DateTime (20130813T173000Z) or Floating DateTime (20130813T173000)
dateTimeValue.floatingTime = (ics.indexOf('Z') !== ics.length - 1) ? true : false;
dateTimeValue.dateTime = moment(ics, 'YYYYMMDDTHHmmssZ').utc();
dateTimeValue.dateTime = moment.utc(ics, 'YYYYMMDDTHHmmssZ');
}
};

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"bugs": {
"url": "https://github.com/sunrise/vobject-js/issues"
},
"version": "0.0.33",
"version": "0.0.34",
"dependencies": {
"moment-timezone": "0.2.x",
"underscore": "1.7.x"
"moment-timezone": "0.4.0",
"underscore": "1.8.3"
},
"devDependencies": {
"mocha": "latest",
Expand Down
6 changes: 6 additions & 0 deletions test/vobject/dateTimeValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ describe('lib/vobject/dateTimeValue.js', function() {
assert.equal(dateTimeValue.toICS(), '20130814T063340');
});

it('should use latest Chilean DST settings', function() {
var dateTimeValue = vobject.dateTimeValue('2015-06-09T14:00:00+00:00');
dateTimeValue.tzid = 'America/Santiago';
assert.equal(dateTimeValue.toICS(), '20150609T110000');
});

it('should default to absolute time on garbage tzid', function() {
var dateTimeValue = vobject.dateTimeValue('2013-08-13T17:33:40-04:00');
dateTimeValue.tzid = 'garbage';
Expand Down

0 comments on commit 4760b7b

Please sign in to comment.