Skip to content

Instantly share code, notes, and snippets.

@wmadden
Created April 26, 2017 09:08
Show Gist options
  • Save wmadden/a1545ed006124f8ea8191b307fef525c to your computer and use it in GitHub Desktop.
Save wmadden/a1545ed006124f8ea8191b307fef525c to your computer and use it in GitHub Desktop.
ember-flatpickr time picker broken bug
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
onFlatpickrChange(dates) {
console.log(dates);
},
flatpickrValue: new Date(),
});
<h1>ember-flatpickr time picker broken bug</h1>
A default value of "new Date()" is supplied to the `ember-flatpickr` instance.
<br>
<br>
The initial value is incorrect: it does not display the time component of the date.
<br>
<br>
Subsequent selections also display incorrectly, i.e. without the time component.
<br>
<br>
However, the `onChange` handler is invoked with the correct date instance by flatpickr (including the time component).
<br>
<br>
{{ember-flatpickr
allowInput=true
onChange=null
enableTime=true
value=(readonly flatpickrValue)
}}
{
"version": "0.12.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1",
"ember-flatpickr": "1.1.7"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment