let React = require("react");
let moment = require("moment");

let HistoryItem = React.createClass({
  statics: {
    truncate: function (s) {
      let newString = s.substr(0, 100);
      if (s.length > 100) {
        newString += "..."
      }
      return newString
    },
    getTime: function (t) {
      return moment(t).format("HH:mm:ss");
    }
  },
  render: function () {
    return (
      <tr>
        <td className="mdl-data-table__cell--non-numeric">{this.constructor.getTime(this.props.visited)}</td>
        <td className="mdl-data-table__cell--non-numeric"><img src={"chrome://favicon/" + this.props.url} /></td>
        <td className="mdl-data-table__cell--non-numeric">
          <a href={this.props.url} target="_blank">{this.constructor.truncate(this.props.title || this.props.url)}</a>
        </td>
      </tr>
    );
  }
});

module.exports = HistoryItem;
let React = require("react");
let moment = require("moment");

let HistoryItem = React.createClass({
  statics: {
    truncate: function (s) {
      let newString = s.substr(0, 100);
      if (s.length > 100) {
        newString += "..."
      }
      return newString
    },
    getTime: function (t) {
      return moment(t).format("hh:mm:ss A");
    }
  },
  render: function () {
    return (
      <tr>
        <td className="mdl-data-table__cell--non-numeric">{this.constructor.getTime(this.props.visited)}</td>
        <td className="mdl-data-table__cell--non-numeric"><img src={"chrome://favicon/" + this.props.url} /></td>
        <td className="mdl-data-table__cell--non-numeric">
          <a
            href={this.props.url}
            target="_blank"
            className="mdl-badge"
            data-badge={this.props.count}>
            {this.constructor.truncate(this.props.title || this.props.url)}
          </a>
        </td>
      </tr>
    );
  }
});

module.exports = HistoryItem;
Update 24-hour time to 12-hour; and added visit count badge
Update 24-hour time to 12-hour; and added visit count badge

- 12-hour time is easier to read (AM / PM)
- Playing around with MDL badge to show total number of times a page has been visited (room for improvement)
