diff --git a/package.json b/package.json index a51c61ef0..31bbc56dc 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "mkdirp": "^0.5", "moment": "2.12.0", "moment-round": "^1.0.1", - "moment-timezone": "0.5.2", + "moment-timezone": "0.5.4", "mousetrap": "^1.5.3", "nock": "^2", "node-uuid": "^1.4", diff --git a/src/flux/models/utils.coffee b/src/flux/models/utils.coffee index aa3055e68..1fed99bf2 100644 --- a/src/flux/models/utils.coffee +++ b/src/flux/models/utils.coffee @@ -2,7 +2,12 @@ _ = require 'underscore' fs = require('fs-plus') path = require('path') moment = require('moment-timezone') -tz = Intl.DateTimeFormat().resolvedOptions().timeZone ? moment.tz.guess() + +# Attempts to use Intl.DateTimeFormat().resolvedOptions().timeZone, falls back +# to intelligently guessing based on how key dates over one year are formatted. +tz = moment.tz.guess() +if not tz + console.error("Utils:TimeZone could not be determined. This should not happen!") DefaultResourcePath = null TaskRegistry = require('../../task-registry').default