function createHistoryEntry(timestamp, urlStr) {
  if (typeof timestamp === 'string')
    timestamp += ' UTC';

  const d = new Date(timestamp);
  const url = new URL(urlStr);
  const domain = url.host;
  return {
    allTimestamps: [timestamp],
    // Formatting the relative day is too hard, will instead display
    // YYYY-MM-DD.
    dateRelativeDay: d.toISOString().split('T')[0],
    dateTimeOfDay: d.getUTCHours() + ':' + d.getUTCMinutes(),
    domain: domain,
    starred: false,
    time: d.getTime(),
    title: urlStr,
    url: urlStr
  };
}
/**
 * Create a fake history result with the given timestamp.
 * @param {number|string} timestamp Timestamp of the entry, as a number in ms or
 * a string which can be parsed by Date.parse().
 * @param {string} urlStr The URL to set on this entry.
 * @return {!HistoryEntry} An object representing a history entry.
 */
Create a fake history result with the given timestamp.
@param {number|string} timestamp Timestamp of the entry, as a number in ms or
a string which can be parsed by Date.parse().
@param {string} urlStr The URL to set on this entry.
@return {!HistoryEntry} An object representing a history entry.
Create a fake history result with the given timestamp . @param { number|string } timestamp Timestamp of the entry as a number in ms or a string which can be parsed by Date . parse () . @param { string } urlStr The URL to set on this entry . @return { !HistoryEntry } An object representing a history entry .
function createHistoryEntry(timestamp, urlStr) {
  if (typeof timestamp === 'string')
    timestamp += ' UTC';
  const d = new Date(timestamp);
  const url = new URL(urlStr);
  const domain = url.host;
  return {
    allTimestamps: [timestamp],
    dateRelativeDay: d.toISOString().split('T')[0],
    dateTimeOfDay: d.getUTCHours() + ':' + d.getUTCMinutes(),
    domain: domain,
    starred: false,
    time: d.getTime(),
    title: urlStr,
    url: urlStr
  };
}
function createHistoryEntry ( timestamp , urlStr ) { if ( typeof timestamp === 'string' ) timestamp += ' UTC' ; const d = new Date ( timestamp ) ; const url = new URL ( urlStr ) ; const domain = url . host ; return { allTimestamps : [ timestamp ] , dateRelativeDay : d . toISOString ( ) . split ( 'T' ) [ 0 ] , dateTimeOfDay : d . getUTCHours ( ) + ':' + d . getUTCMinutes ( ) , domain : domain , starred : false , time : d . getTime ( ) , title : urlStr , url : urlStr } ; }
Create a fake history result with the given timestamp.
Create a fake history result with the given timestamp .
// Formatting the relative day is too hard, will instead display // YYYY-MM-DD.