James Moger
2012-10-18 13417cf9c6eec555b51da49742e47939d2f5715b
src/com/gitblit/client/DateCellRenderer.java
@@ -37,7 +37,7 @@
   private static final long serialVersionUID = 1L;
   private final String pattern;
   public DateCellRenderer(String pattern, Color foreground) {
      this.pattern = (pattern == null ? "yyyy-MM-dd HH:mm" : pattern);
      setForeground(foreground);
@@ -49,18 +49,23 @@
      super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
      if (value instanceof Date) {
         Date date = (Date) value;
         String timeAgo;
         String strDate;
         String title;
         String dateString;
         if (date.getTime() == 0) {
            timeAgo = "--";
            strDate = "never";
            title = "--";
            dateString = "never";
         } else {
            timeAgo = TimeUtils.timeAgo(date);
            strDate = new SimpleDateFormat(pattern).format((Date) value);
            title = Translation.getTimeUtils().timeAgo(date);
            dateString = new SimpleDateFormat(pattern).format((Date) value);
         }
         this.setText(timeAgo);
         this.setToolTipText(strDate);
         if ((System.currentTimeMillis() - date.getTime()) > 10 * 24 * 60 * 60 * 1000L) {
            String tmp = dateString;
            dateString = title;
            title = tmp;
         }
         this.setText(title);
         this.setToolTipText(dateString);
      }
      return this;
   }