Merge pull request #54 from prokls/master

SensingPrims.primTimestamp and Daylight Savings Time
This commit is contained in:
Shane M. Clements 2014-04-09 23:33:06 -06:00
commit 62abf8d547
2 changed files with 2 additions and 2 deletions

View file

@ -245,7 +245,7 @@ SensingPrims.prototype.primTimestamp = function(b) {
var epoch = new Date(2000, 0, 1);
var dst = now.getTimezoneOffset() - epoch.getTimezoneOffset();
var msSince = now.getTime() - epoch.getTime();
msSince += (now.getTimezoneOffset() - dst) * 60000;
msSince -= dst * 60000;
return msSince / 86400000;
};

View file

@ -22,7 +22,7 @@ describe('SensingPrims', function() {
});
it('should return the days since 2000', function() {
expect(sensingPrims.prototype.primTimestamp()).toEqual(5280.25);
expect(sensingPrims.prototype.primTimestamp()).toBeCloseTo(5280);
});
});