From f2777247491107ec50594b242a07a56c319078a8 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 30 Jun 2016 12:11:41 -0400 Subject: [PATCH] fix(GUI): incorrect ETA on certain timezones (#545) In certain timezones, like India's, the ETA would display very weird numbers. The problem was that we passed a number of milliseconds to MomentJS, which created a Date object based on it taking timezones into consideration. As a solution, we convert the seconds to a Date object containing the lowest possible date values, and set its seconds to the ETA, since this effectively represents just the number of seconds we're interested in. Changelog-Entry: Fix incorrect ETA numbers in certain timezones. Change-Type: patch Signed-off-by: Juan Cruz Viotti --- lib/gui/app.js | 1 + lib/gui/partials/main.html | 5 +---- npm-shrinkwrap.json | 5 +++++ package.json | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/gui/app.js b/lib/gui/app.js index 2a057a03..8da48ab4 100644 --- a/lib/gui/app.js +++ b/lib/gui/app.js @@ -35,6 +35,7 @@ const app = angular.module('Etcher', [ require('angular-moment'), require('angular-middle-ellipses'), require('angular-if-state'), + require('angular-seconds-to-date'), // Etcher modules require('./modules/drive-scanner'), diff --git a/lib/gui/partials/main.html b/lib/gui/partials/main.html index f731f2c8..395cc5c0 100644 --- a/lib/gui/partials/main.html +++ b/lib/gui/partials/main.html @@ -112,10 +112,7 @@ diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3a305de6..60003166 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -59,6 +59,11 @@ "from": "angular-moment@>=1.0.0-beta.6 <2.0.0", "resolved": "https://registry.npmjs.org/angular-moment/-/angular-moment-1.0.0-beta.6.tgz" }, + "angular-seconds-to-date": { + "version": "1.0.0", + "from": "angular-seconds-to-date@latest", + "resolved": "https://registry.npmjs.org/angular-seconds-to-date/-/angular-seconds-to-date-1.0.0.tgz" + }, "angular-ui-bootstrap": { "version": "1.3.3", "from": "angular-ui-bootstrap@>=1.3.2 <2.0.0", diff --git a/package.json b/package.json index 9ff3f60f..9af58d91 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "angular-if-state": "^1.0.0", "angular-middle-ellipses": "^1.0.0", "angular-moment": "^1.0.0-beta.6", + "angular-seconds-to-date": "^1.0.0", "angular-ui-bootstrap": "^1.3.2", "angular-ui-router": "^0.2.18", "bluebird": "^3.0.5",