common/vueapp/vueFilters.js
// used in parseSeconds to determine the unit of relative time
used in parseSeconds to determine the unit of relative time
used in parseSeconds to determine the unit of relative time
function str2format (str) {
  if (str.match(/^(s|sec|secs|second|seconds)$/)) {
    return 'seconds';
  } else if (str.match(/^(m|min|mins|minute|minutes)$/)) {
    return 'minutes';
  } else if (str.match(/^(h|hr|hrs|hour|hours)$/)) {
    return 'hours';
  } else if (str.match(/^(d|day|days)$/)) {
    return 'days';
  } else if (str.match(/^(w|week|weeks)\d*$/)) {
    return 'weeks';
  } else if (str.match(/^(M|mon|mons|month|months)$/)) {
    return 'months';
  } else if (str.match(/^(q|qtr|qtrs|quarter|quarters)$/)) {
    return 'quarters';
  } else if (str.match(/^(y|yr|yrs|year|years)$/)) {
    return 'years';
  }
  return undefined;
}
function str2format ( str ) { if ( str . match ( / ^(s|sec|secs|second|seconds)$ / ) ) { return 'seconds' ; } else if ( str . match ( / ^(m|min|mins|minute|minutes)$ / ) ) { return 'minutes' ; } else if ( str . match ( / ^(h|hr|hrs|hour|hours)$ / ) ) { return 'hours' ; } else if ( str . match ( / ^(d|day|days)$ / ) ) { return 'days' ; } else if ( str . match ( / ^(w|week|weeks)\d*$ / ) ) { return 'weeks' ; } else if ( str . match ( / ^(M|mon|mons|month|months)$ / ) ) { return 'months' ; } else if ( str . match ( / ^(q|qtr|qtrs|quarter|quarters)$ / ) ) { return 'quarters' ; } else if ( str . match ( / ^(y|yr|yrs|year|years)$ / ) ) { return 'years' ; } return undefined ; }
used in parseSeconds to determine the unit of relative time
used in parseSeconds to determine the unit of relative time