ember-date-components
v4.0.1
Published
An Ember add-on which provides pure Ember-based date picker components.
Downloads
481
Maintainers
Readme
ember-date-components
An Ember add-on which provides pure Ember-based date picker components.
Compatibility
- Ember.js v3.16 or above
- Ember CLI v2.13 or above
- Node.js v10 or above
Installation
ember install ember-moment
- This is a dependency that you will need to install manuallyember install ember-date-components
Basic Usage
<DatePicker @value={{this.date}} @onChange={{this.updateDate}} />
<DatePicker @range={{true}} @value={{this.dateRange}} @onChange={{this.updateDateRange}} />
<TimePicker @value={{this.time}} @onChange={{this.updateTime}} />
<DateTimePicker @value={{this.date}} @onChange={{this.updateDateTime}} />
The date picker can also display custom options, e.g. 'Last 7 days'.
It also provides test helpers to easily interact with the date picker in integration & acceptance tests:
import { selectDate, selectDateRange, getSelectedDate, selectDateTime } from 'ember-date-components/test-support/helpers/date-picker';
import { selectTime, getSelectedTime } from 'ember-date-components/test-support/helpers/time-picker';
await selectDate('.my-datepicker', moment());
let momentInstance = await getSelectedDate('.my-datepicker');
await selectTime('.my-timepicker', moment());
let momentInstance = await getSelectedTime('.my-timepicker');
await selectDateTime('.my-date-time-picker', moment());
await selectDateRange('.my-datepicker', dateFrom, dateTo);
For more detailed instructions and examples, please visit the documentation.