fix(tz): Update moment, internally uses Intl.DateTimeFormat()

This commit is contained in:
Ben Gotow 2016-06-06 15:20:38 -07:00
parent 23ee4b5c76
commit 17d9c3d717
2 changed files with 7 additions and 2 deletions

View file

@ -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",

View file

@ -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