All Projects → willrax → ember-luxon

willrax / ember-luxon

Licence: MIT License
🕐 🌐 [deprecated] Addon thats brings Luxon to Ember applications.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
Handlebars
879 projects

Projects that are alternatives of or similar to ember-luxon

Ember Simple Auth Auth0
Auth0 + lock.js, built on ember-simple-auth
Stars: ✭ 53 (+165%)
Mutual labels:  ember-cli, ember, ember-addon
ember-cli-ifa
Ember CLI addon for injecting fingerprinted asset map file into Ember app
Stars: ✭ 54 (+170%)
Mutual labels:  ember-cli, ember, ember-addon
Ember Decorators
Useful decorators for Ember applications.
Stars: ✭ 360 (+1700%)
Mutual labels:  ember-cli, ember, ember-addon
ember-credit-card
"make your credit card form dreamy in one line of code"
Stars: ✭ 89 (+345%)
Mutual labels:  ember-cli, ember, ember-addon
ember-template-inspector
An ember add-on which opens the template file in the code editor while inspecting an element.
Stars: ✭ 15 (-25%)
Mutual labels:  ember-cli, ember, ember-addon
Ember Cli Bundle Analyzer
Analyze the size and contents of your Ember app's bundles
Stars: ✭ 78 (+290%)
Mutual labels:  ember-cli, ember, ember-addon
Ember Cli Coffeescript
Adds precompilation of CoffeeScript files and all the basic generation types to the ember generate command.
Stars: ✭ 72 (+260%)
Mutual labels:  ember-cli, ember, ember-addon
ember-cli-string-helpers
Set of the String helpers extracted from DockYard's ember-composable-helpers.
Stars: ✭ 73 (+265%)
Mutual labels:  ember-cli, ember, ember-addon
Ember Cli Notifications
⚛ Atom inspired notification messages for ember-cli
Stars: ✭ 168 (+740%)
Mutual labels:  ember-cli, ember, ember-addon
Ember Cli Stripe
Stripe checkout for Ember
Stars: ✭ 84 (+320%)
Mutual labels:  ember-cli, ember, ember-addon
ember-cli-nouislider
{{range-slider}} component for ember-cli powered by noUiSlider
Stars: ✭ 43 (+115%)
Mutual labels:  ember-cli, ember, ember-addon
ember-content-loader
Easy, customizable content placeholders / skeletons screens
Stars: ✭ 41 (+105%)
Mutual labels:  ember-cli, ember, ember-addon
ember-google-charts
Google's Material charts made easy for Ember apps - http://sir-dunxalot.github.io/ember-google-charts/
Stars: ✭ 31 (+55%)
Mutual labels:  ember, ember-addon
ember-shadow-dom
Write templates for your components inside of a Shadow DOM root.
Stars: ✭ 26 (+30%)
Mutual labels:  ember, ember-addon
ember-bootstrap-power-select
Integrate ember-power-select into your ember-bootstrap forms
Stars: ✭ 37 (+85%)
Mutual labels:  ember, ember-addon
ember-query-params
Ember service for your query params
Stars: ✭ 44 (+120%)
Mutual labels:  ember, ember-addon
ember-named-yields
Named Yields for Ember Components
Stars: ✭ 17 (-15%)
Mutual labels:  ember, ember-addon
ember-language-server
Language Server Protocol implementation for Ember.js projects
Stars: ✭ 93 (+365%)
Mutual labels:  ember-cli, ember
ember-fsm
[Maintenance Mode] A promise-aware finite state machine implementation for Ember
Stars: ✭ 37 (+85%)
Mutual labels:  ember, ember-addon
cli-guides
Step-by-step guides and tutorials for using the ember-cli to create apps and addons
Stars: ✭ 22 (+10%)
Mutual labels:  ember-cli, ember

ember-luxon

Deprecated. I no longer work with Ember so it's tricky to keep this up to date. If you require this library, I'd suggest forking it. Alternatively, install luxon directly and copy the helpers in.

NPM version CircleCI

An addon to allow importing of Luxon in your Ember Apps.

Installation

  • ember install ember-luxon;

Most modern browers will work fine with luxon. If you need to support legacy browsers you will need to include some polyfills.

You can provide an option in your apps ember-cli-build.js file and we'll add intl.js to your build.

'ember-luxon': {
  includeIntlPolyfill: true
}

See the Luxon support matrix for more information and which browsers support which features and other caveats.

Usage

import { DateTime, Duration, Info, Interval, Settings, Zone } from 'ember-luxon';
import Component from '@ember/component';

export default Component.extend({
  theTime: computed(function() {
    return DateTime.local()
  })
});

Helpers

Ember luxon provices some helpers for use in templates.

luxon

Given a string and a format it will generate a luxon datetime object.

{{luxon "2014 Aug 06" "yyyy LLL dd"}}

luxon-diff

This will determine the length of time between two days. Precision is optional and will default to milliseconds.

{{luxon-diff dateOne dateTwo}}                  /* 86400000
{{luxon-diff dateOne dateTwo precision="days"}} /* 1

luxon-format

Given a datetime object it will format it. If you don't provide a format string ember-luxon will default to using local formatting.

{{luxon-format dateOne format="yyyy LLL dd"}} /* "2014 Aug 06"
{{luxon-format dateOne}}                      /* "4/20/2017"

luxon-is-after

Will return true or false depending on whether the first dateTime is after the second.

{{luxon-is-after earlyDate lateDate}} /* true
{{luxon-is-after lateDate earlyDate}} /* false

luxon-is-before

Will return true or false depending on whether the first dateTime is before the second.

{{luxon-is-before earlyDate lateDate}} /* true
{{luxon-is-before lateDate earlyDate}} /* false

luxon-is-before

Will return true or false depending on whether the first dateTime is contained within a pair of dates.

{{luxon-is-before dateTime startDate endDate}} /* true

luxon-is-same

Will return true or false depending on whether the first dateTime is the same as the other date. You can set the precision here to verify if it is the day, millisecond, hour etc.

{{luxon-is-same dateTime dateTime}}                        /* true
{{luxon-is-same dateTime dateTimeTwo precision="day"}}     /* true
{{luxon-is-same dateTime dateTimeThree precision="month"}} /* true
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].