Search code examples
javascriptember.jsember-cli

Ember.js date picker


Is there any default date picker in Ember JS ? I see there is a date picker in Ember CLI, but I am not sure If I can use it or not.

Any help will be useful in this direction.


Solution

  • There's no default datepicker for Ember.js. However addon you are talking about - Ember CLI Datepicker works great. It uses Pikaday which supports following browsers: Pikaday comptaibility

    Usage of Ember CLI Datepicker is simple, you can use following code for creating datepicker for birthday:

    {{date-picker date=model.birthday valueFormat='date' yearRange="-100, 0"}}
    

    Installation is very simple if you use Ember CLI:

    ember install:addon ember-cli-datepicker
    

    If you are worried if you can use it with recent stable versions of Ember.js - the answer is yes. It works with latest version which is 1.9.1. You can, of course, use it with Ember Data too.

    If you're not using Ember CLI, this answer might be helpful.