Lightweight date helpers for your ember-cli application thanks to date-fns. If all you need is to format a date, Ember date-fns will help you.
If you are looking for more features, see ember-moment instead.
In your ember-cli project, run either
ember install ember-date-fns
or
yarn add ember-date-fns
or
npm install --save ember-date-fns
All helpers map to the date-fns function of the same name.
Uses format to format a date object, string or timestamp.
Uses distanceInWordsToNow to return "time ago". By default no suffix is added.
date-fns
provides many functions for manipulating dates. In order to reduce bundle size only date-fns/distance_in_words_to_now
and date-fns/format
helpers are included by default. However you can import any functions anywhere in your application.
Example:
// app/components/some-component.js
import Ember from 'ember';
import endOfDay from 'date-fns/end_of_day';
// Your component code here...