from-now.js 380 B

123456789101112131415
  1. import Ember from 'ember';
  2. export function fromNow(input, options) {
  3. if (input) {
  4. if (typeof options !== 'undefined' && typeof options.hash.nosuffix !== 'undefined') {
  5. return input.fromNow(options.hash.nosuffix);
  6. } else {
  7. return input.fromNow();
  8. }
  9. } else {
  10. return gettext('never');
  11. }
  12. }
  13. export default Ember.Handlebars.makeBoundHelper(fromNow);