web/js/helpers/timer_display.js
/**
 * Renders a duration in milliseconds into a string
 * @example
 *
 *     letters(122000) => '2m'
 */
Renders a duration in milliseconds into a string
@example


Renders a duration in milliseconds into a string @example
function letters (
  ms ,
  isRemaining ) {
  if (ms > 60000) ms = Math.round(ms / 60000) * 60000
  let { sign, hours, mins, secs } = parse(ms, isRemaining)
  let result = []
  if (hours > 0) result = [...result, `${hours}h`]
  if (mins > 0) result = [...result, `${mins}m`]
  if (hours === 0 && mins === 0) result = [...result, `${secs}s`]
  return `${sign}${result.join(' ')}`
}
function letters ( ms , isRemaining ) { if ( ms > 60000 ) ms = Math . round ( ms / 60000 ) * 60000 let { sign , hours , mins , secs } = parse ( ms , isRemaining ) let result = [ ] if ( hours > 0 ) result = [ ... result , ` ${ hours } ` ] if ( mins > 0 ) result = [ ... result , ` ${ mins } ` ] if ( hours === 0 && mins === 0 ) result = [ ... result , ` ${ secs } ` ] return ` ${ sign } ${ result . join ( ' ' ) } ` }
Renders a duration in milliseconds into a string
 @example
Renders a duration in milliseconds into a string @example
/*: number */ /*: ?boolean */