Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@filerobot/utils / lib / humanReadableDateWithTranslations.js
Size: Mime:
import capitalizeFirstLetter from './capitalizeFirstLetter';
import humanReadableDate from './humanReadableDate';

/**
 * Wrapper over function humanReadableDate but with translations
 */
var humanReadableDateWithTranslations = function humanReadableDateWithTranslations(date, i18n) {
  var t = function t(str) {
    return i18n("timeAgo".concat(str.split(' ').filter(Boolean).map(function (item) {
      return capitalizeFirstLetter(item.trim());
    }).join('')), str) || str;
  };
  return humanReadableDate(date, {
    ago: t('ago'),
    second: t('second'),
    seconds: t('seconds'),
    minute: t('minute'),
    minutes: t('minutes'),
    hour: t('hour'),
    hours: t('hours'),
    day: t('day'),
    days: t('days'),
    month: t('month'),
    months: t('months'),
    year: t('year'),
    years: t('years')
  });
};
export default humanReadableDateWithTranslations;