Travis.Helpers.Common = {
  colorForStatus: function(result) {
    return result == 0 ? 'green' : result == 1 ? 'red' : null;
  },

  timeAgoInWords: function(date) {
    return $.timeago.distanceInWords(date);
  },

  durationFrom: function(started, finished) {
    started  = started  && new Date(this._normalizeDateString(started)).getTime();
    finished = finished ? new Date(this._normalizeDateString(finished)).getTime() : this._nowUtc();
    return started && finished ? Math.round((finished - started) / 1000) : 0;
  },

  readableTime: function(duration) {
    var days    = Math.floor(duration / 86400);
    var hours   = Math.floor(duration % 86400 / 3600);
    var minutes = Math.floor(duration % 3600 / 60);
    var seconds = duration % 60;

    if(days > 0) {
      return 'more than 24 hrs';
    } else {
      var result = [];
      if(hours  == 1) { result.push(hours + ' hr'); }
      if(hours   > 1) { result.push(hours + ' hrs'); }
      if(minutes > 0) { result.push(minutes + ' min'); }
      if(seconds > 0) { result.push(seconds + ' sec'); }
      return result.length > 0 ? result.join(' ') : '-';
    }
  },

  _normalizeDateString: function(string) {
    if(window.JHW) {
      // TODO i'm not sure why we need to do this. in the chrome console the
      // Date constructor would take a string like "2011-09-02T15:53:20.927Z"
      // whereas in unit tests this returns an "invalid date". wtf ...
      string = string.replace('T', ' ').replace(/-/g, '/');
      string = string.replace('Z', '').replace(/\..*$/, '');
    }
    return string;
  },

  _nowUtc: function() {
    var now = new Date();
    return Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds());
  }
};

@@ -283,16 +283,28 @@
 ted  && 
+this._toUtc(
 new Date
@@ -339,25 +339,16 @@
 tarted))
-.getTime(
 );%0A    f
@@ -368,16 +368,28 @@
 ished ? 
+this._toUtc(
 new Date
@@ -429,17 +429,8 @@
 ed))
-.getTime(
 ) : 
@@ -1609,18 +1609,27 @@
     
-var now = 
+return this._toUtc(
 new 
@@ -1634,18 +1634,54 @@
 w Date()
+)
 ;%0A
+  %7D,%0A  %0A  _toUtc: function(date) %7B%0A
     retu
@@ -1692,19 +1692,20 @@
 ate.UTC(
-now
+date
 .getFull
@@ -1708,27 +1708,28 @@
 FullYear(), 
-now
+date
 .getMonth(),
@@ -1725,27 +1725,28 @@
 getMonth(), 
-now
+date
 .getDate(), 
@@ -1741,27 +1741,28 @@
 .getDate(), 
-now
+date
 .getHours(),
@@ -1758,27 +1758,28 @@
 getHours(), 
-now
+date
 .getMinutes(
@@ -1777,27 +1777,28 @@
 tMinutes(), 
-now
+date
 .getSeconds(
@@ -1800,19 +1800,20 @@
 onds(), 
-now
+date
 .getMill

Fix for "duration time bug".