Closed lazybensch closed 8 years ago
This would we be sweet since I've been doing this with an observer
onDatePickerValueChanged: Ember.observer('datePickerValue', function() {
})
which isn't the cleanest.
@soulim any thoughts on this? should i rebase or you wanna discuss/close this PR?
I'm sorry for delay @lazybensch. Your idea and PR looks great! :+1: Could you please rebase the branch? I'll be happy to merge it as soon as you finish with rebase.
Thank you! :heart:
no worries @soulim. rebased the branch. CI is broken (on master though). looks mergable to me.
Thank a lot! Don't worry about CI. It has nothing to your PR.
Wish you a wonderful day! :smile:
@lazybensch @soulim: The test ''resets date when input is cleared'' introduced by this PR hasn't ever passed. At least if I git checkout 1e5df180bb1323bd7bf73c7f440760921b3fe708
, update ember to 1.13.13 and run tests against it fails.
This PR is related to #58. we too need the input value for our datepicker to sometimes be something else then a date. But I understand that using the
Date
constructor internally is unreliable. With this PR I simply introduce an API for the user to plug in a custom parser for the date string. This way anyone can decide by him/herself how to process the dates for a particular picker.to solve @maladon's issue, he now could do:
and inside his code:
The responsibility for how to parse is now in user land. If you want to, you could do fancy stuff with
moment.js
or other libraries not available from insidebootstrap-datepicker