function shortDateFormat(then) {
  var locale = window.navigator.userLanguage || window.navigator.language;
  var now = new Date();
  if (then.getFullYear() === now.getFullYear()) {
    if (then.getMonth() === now.getMonth() && then.getDate() === now.getDate()) {
      return then.toLocaleTimeString(locale, { hour12: false, hour: '2-digit', minute: '2-digit' });
    } else {
      return then.toLocaleDateString(locale, {
        hour12: false,
        month: 'short',
        day: 'numeric',
        hour: '2-digit',
        minute: '2-digit',
      });
    }
  }
  return then.toLocaleDateString(locale, {
    hour12: false,
    year: 'numeric',
    month: 'short',
    day: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
  });
}
// Short representation of time in the past.
Short representation of time in the past.
Short representation of time in the past .
function shortDateFormat(then) {
  var locale = window.navigator.userLanguage || window.navigator.language;
  var now = new Date();
  if (then.getFullYear() === now.getFullYear()) {
    if (then.getMonth() === now.getMonth() && then.getDate() === now.getDate()) {
      return then.toLocaleTimeString(locale, { hour12: false, hour: '2-digit', minute: '2-digit' });
    } else {
      return then.toLocaleDateString(locale, {
        hour12: false,
        month: 'short',
        day: 'numeric',
        hour: '2-digit',
        minute: '2-digit',
      });
    }
  }
  return then.toLocaleDateString(locale, {
    hour12: false,
    year: 'numeric',
    month: 'short',
    day: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
  });
}
function shortDateFormat ( then ) { var locale = window . navigator . userLanguage || window . navigator . language ; var now = new Date ( ) ; if ( then . getFullYear ( ) === now . getFullYear ( ) ) { if ( then . getMonth ( ) === now . getMonth ( ) && then . getDate ( ) === now . getDate ( ) ) { return then . toLocaleTimeString ( locale , { hour12 : false , hour : '2-digit' , minute : '2-digit' } ) ; } else { return then . toLocaleDateString ( locale , { hour12 : false , month : 'short' , day : 'numeric' , hour : '2-digit' , minute : '2-digit' , } ) ; } } return then . toLocaleDateString ( locale , { hour12 : false , year : 'numeric' , month : 'short' , day : 'numeric' , hour : '2-digit' , minute : '2-digit' , } ) ; }
Short representation of time in the past.
Short representation of time in the past .