Open malatin3 opened 8 years ago
Regardless of timezones, I think having a mode that supports using moment as the base type instead of js dates would be quite useful. We're looking at updating our app to use moment everywhere in place of dates and the one thing that's making that a little tricky is the date picker.
We're currently looking at using computed properties to do translations between the date picker and the underlying data but it's not an ideal solution.
In our app we also do the translations between the date picker and the underlying data and I agree this is a suboptimal solution. One of the odd things that result is that UTC and non-UTC behave differently, since the underlying logic is different.
A possible work-around would be to inspect the value
passed to setPikadayDate
(https://github.com/edgycircle/ember-pikaday/blob/master/addon/mixins/pikaday.js#L74) and convert the moment object to a date there if needed.
Welcoming a PR, surely.
I plan on sending a pull request for this :-) While looking into the code I asked myself the purpose of lines 147-159 in mixins/pikaday.js as these seem to call empty functions ... are those lines relevant (for this patch)? @duizendnegen
I'm traveling until January 16th, will review after. Just from the top of mind: it could be that these empty functions are extension points and public API, but not sure
On Wed, 4 Jan 2017, 18:06 MikiDi, notifications@github.com wrote:
I plan on sending a pull request for this :-) While looking into the code I asked myself the purpose of lines 147 https://github.com/edgycircle/ember-pikaday/blob/7f154c58fa0876b56ff563d6cbf2b788f0c27b05/addon/mixins/pikaday.js#L147 -159 https://github.com/edgycircle/ember-pikaday/blob/7f154c58fa0876b56ff563d6cbf2b788f0c27b05/addon/mixins/pikaday.js#L159 in mixins/pikaday.js https://github.com/edgycircle/ember-pikaday/blob/7f154c58fa0876b56ff563d6cbf2b788f0c27b05/addon/mixins/pikaday.js as these seem to call empty functions ... are those lines relevant (for this patch)? @duizendnegen https://github.com/duizendnegen
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/edgycircle/ember-pikaday/issues/106#issuecomment-270441365, or mute the thread https://github.com/notifications/unsubscribe-auth/AAoow7nCoYmGkMWP_6LSCq1Nll9SEvRFks5rO9-VgaJpZM4Jmp0e .
Are there any plans to support passing moments directly to the component as a value (using Pikaday's get/setMoment functions) or are we stuck with using native JavaScript Date objects?
I have a use case where I need to display a date in a time zone that is neither my local time zone nor utc.
Edit: I take it back, it doesn't look like Pikaday supports timezones even if you use setMoment..
Feel free to close this. haha