0.5.15 • Published 8 months ago

ember-dayjs-helpers v0.5.15

Weekly downloads
108
License
MIT
Repository
github
Last release
8 months ago

ember-dayjs-helpers

Build and Deploy Coverage Status semantic-release npm version EmberObserver

30+ Ember.js template helpers based on day.js, a fast 2kB alternative to Moment.js with the same modern API

Installation

ember install ember-dayjs-helpers

Usage

View the Demo page for more examples.

Using in templates

{{ 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

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 guide for details.

License

This project is licensed under the MIT License.

0.5.14

8 months ago

0.5.15

8 months ago

0.5.13

8 months ago

0.5.12

2 years ago

0.5.11

2 years ago

0.5.10

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

0.0.0

4 years ago