https://github.com/rajasegar/ember-dayjs-helpers
Ember Template helpers based on day.js
https://github.com/rajasegar/ember-dayjs-helpers
date datetime dayjs ember-addon format
Last synced: 8 months ago
JSON representation
Ember Template helpers based on day.js
- Host: GitHub
- URL: https://github.com/rajasegar/ember-dayjs-helpers
- Owner: rajasegar
- License: mit
- Created: 2020-07-11T07:32:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-08-28T06:07:33.000Z (10 months ago)
- Last Synced: 2025-08-28T12:51:49.455Z (10 months ago)
- Topics: date, datetime, dayjs, ember-addon, format
- Language: JavaScript
- Homepage: https://rajasegar.github.io/ember-dayjs-helpers
- Size: 1.81 MB
- Stars: 20
- Watchers: 2
- Forks: 3
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
ember-dayjs-helpers
==============================================================================

[](https://coveralls.io/github/rajasegar/ember-dayjs-helpers?branch=master)
[](https://github.com/semantic-release/semantic-release)
[](https://npmjs.org/package/ember-dayjs-helpers "View this project on npm")
[](http://emberobserver.com/addons/ember-dayjs-helpers)
30+ Ember.js template helpers based on [day.js](https://day.js.org/en), a fast 2kB alternative to Moment.js with the same modern API
Installation
------------------------------------------------------------------------------
```
ember install ember-dayjs-helpers
```
Usage
------------------------------------------------------------------------------
View the [Demo](https://rajasegar.github.io/ember-dayjs-helpers) page for more examples.
Using in templates
```hbs
{{ day-js }} => Display today's date
{{ day-js date='2019-01-25' format='DD-MM-YYYY'}} => 25-01-2019
{{ day-js date='2019-01-25' format='DD MMMM YYYY'}} => 25 January 2019
```
Using inside Javascript
```js
import dayjs from 'dayjs';
...
const yesterday = dayjs().subtract(1, 'day').toString()
const tomorrow = dayjs().add(1, 'day').toString()
const lastWeek = dayjs().subtract(1, 'week').toString()
const nextWeek = dayjs().add(1, 'week').toString()
const lastMonth = dayjs().subtract(1, 'month').toString()
const nextMonth = dayjs().add(1, 'month').toString()
const lastYear = dayjs().subtract(1, 'year').toString()
const nextYear = dayjs().add(1, 'year').toString()
```
## Helpers
### Display Helpers
- day-js
- dayjs-format
- dayjs-from
- dayjs-from-now
- dayjs-to
- dayjs-to-now
- dayjs-calendar
- dayjs-diff
- days-in-month
- dayjs-date
- dayjs-day-of-week
- dayjs-weekday
- dayjs-day-of-year
- dayjs-week-of-year
### Manipulate Helpers
- dayjs-add
- dayjs-subtract
- dayjs-start-of
- dayjs-end-of
### Query Helpers
- dayjs-is-before
- dayjs-is-same
- dayjs-is-after
- dayjs-is-same-or-before
- dayjs-is-same-or-after
- dayjs-is-between
- dayjs-is-leap-year
### i18n Helpers
- dayjs-weekdays
- dayjs-weekdays-short
- dayjs-weekdays-min
- dayjs-months
- dayjs-months-short
Compatibility
------------------------------------------------------------------------------
* Ember.js v3.12 or above
* Ember CLI v2.13 or above
* Node.js v10 or above
Contributing
------------------------------------------------------------------------------
See the [Contributing](CONTRIBUTING.md) guide for details.
License
------------------------------------------------------------------------------
This project is licensed under the [MIT License](LICENSE.md).