Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2282)

Unified Diff: appengine/cmd/milo/frontend/static/common/js/time.js

Issue 2109473005: Milo: Pending swarming builds (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Cleanup, new test data, fix timing display Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/cmd/milo/frontend/static/common/js/time.js
diff --git a/appengine/cmd/milo/frontend/static/common/js/time.js b/appengine/cmd/milo/frontend/static/common/js/time.js
index 376cfb9a7b9c78a2902b783b9a924458065822be..0eadd04038f00aae3239b7ab8f29f6389e63a1de 100644
--- a/appengine/cmd/milo/frontend/static/common/js/time.js
+++ b/appengine/cmd/milo/frontend/static/common/js/time.js
@@ -16,10 +16,13 @@
*/
milo.formatDate = function(dt) {
if (!dt) {
- return dt;
+ return null;
}
var shortDayNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var t = new Date(dt);
+ if (t.toString() == "Invalid Date") {
+ return null;
+ }
var offset = -(new Date()).getTimezoneOffset();
var offsetHr = Math.abs(Math.round(offset / 60));
var offsetMin = Math.abs(Math.abs(offset) - (offsetHr * 60));

Powered by Google App Engine
This is Rietveld 408576698