Skip to content

Commit

Permalink
workaround runner timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
cesine committed Nov 19, 2024
1 parent 49bf6a4 commit 66d3b75
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
node-version: [12.x]

env:
FAIL_IF_DIST_MESSAGE: "These files are autogenerated. Please don't include changes to these files in your PR "
FAIL_IF_DIST_MESSAGE: "These files are autogenerated. Please don't include changes to these files in your PR"
TZ: "America/New_York"

steps:
- name: Checkout repository
Expand Down
11 changes: 6 additions & 5 deletions tests/Rickshaw.Fixtures.Time.Local.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,21 @@ exports.decemberMonthWrap = function(test) {

exports.yearBoundary = function(test) {

var year2013 = new Date('2013-01-01T05:00:00.000Z').getTime() / 1000;
var year2013 = 1357016400;
var ceil = time.ceil(year2013, time.unit('year'));

test.equal(ceil, year2013, "midnight new year " + new Date(ceil * 1000) + " resolves to itself: " + new Date(year2013 * 1000));
test.equal(ceil, year2013, "midnight new year resolves to itself");
test.done();
};

exports.year = function(test) {
var year2013 = new Date('2013-01-01T05:00:00.000Z').getTime() / 1000;
var year2014 = new Date('2014-01-01T05:00:00.000Z').getTime() / 1000;

var year2013 = 1357016400;
var year2014 = 1388552400;

var ceil = time.ceil(year2013 + 1, time.unit('year'));

test.equal(ceil, year2014, "midnight new year " + new Date(ceil * 1000) + " plus a bit resolves to next year: " + new Date(year2014 * 1000));
test.equal(ceil, year2014, "midnight new year plus a bit resolves to next year");
test.done();
};

0 comments on commit 66d3b75

Please sign in to comment.