ember-dayjs-helpers
Ember Template helpers based on Day.js
Last updated a month ago by rajasegar .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install ember-dayjs-helpers 
SYNC missed versions from official npm registry.

ember-dayjs-helpers

Build Status 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.

Current Tags

  • 0.5.0                                ...           latest (a month ago)

10 Versions

  • 0.5.0                                ...           a month ago
  • 0.4.0                                ...           a month ago
  • 0.3.1                                ...           2 months ago
  • 0.3.0                                ...           2 months ago
  • 0.2.0                                ...           2 months ago
  • 0.1.1                                ...           2 months ago
  • 0.1.0                                ...           2 months ago
  • 0.0.2                                ...           2 months ago
  • 0.0.1                                ...           2 months ago
  • 0.0.0                                ...           2 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 46
Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |