Meteor-Community-Packages / meteor-autoform-bs-datepicker

Custom "bootstrap-datepicker" input type for AutoForm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UTC Date problems

rafaelcorreiapoli opened this issue · comments

Hi, let's say a user picks 18/11/2015 on the datepicker (day 18, month 11 and year 2015)
this date is store on mongo as 18/11/2015 00:00:00 UTC
when I query the db, my app automatically converts this date to my timezone (GMT-2)
and then i get day 17 =(
I think that the datepicker should store the day that I picked - UTC offset so it would store 18/11/2015 - (-2) = 18/11/2015 02:00:00, so when I convert it back to my TZ i would get day 18
Could you guys help me ?

Yep, there's a lot of issues posted here regarding this very issue, yet still nothing has been done about it.

Sort of ridiculous that it works this way, since if you use aldeed's datepicker + autoform + simpleschema + tabular you're going to end up with tables displaying dates a day earlier than what was entered in the autoform because of the way the datepicker works. Odd that his own pieces of software don't play well together.

Mind you they are great packages, but this seems like the simplest issue to fix to have a cohesive, all work together suite of packages, but the issue continues on.

commented

Good to know I'm not the only person dealing with this

It would be helpful to see reproductions for issues like this. The date inputs and outputs work together fine wherever I use this component. I'm not sure, but it sounds like the issue here is that any code you're using to display the selected date in your app is not properly using the UTC date.