Frozenfire92 / ember-pikaday

Deprecated, use this instead: https://github.com/edgycircle/ember-pikaday
Other
12 stars 4 forks source link

String dates parsing as yesterday due to UTC #4

Closed tehviking closed 10 years ago

tehviking commented 10 years ago

We get flat string-formatted dates from a server, and when Moment parses them, it parses them as yesterday (since we're UTC -5). I modified the parser to say var date = moment.utc(self.get('date')); and that fixed the issue for us.

I was thinking of modifiying the library so there'd be an additional flag for something like {{pik-a-day date=date utc=true}}

I could take a look at it and issue a PR if it seems like something you're interested in. If not we have our MEGA HAX version, just seeing if that sounds like something others might need.

tehviking commented 10 years ago

BT-DUBS, thanks for an amazing library. Saved me hours and what's left of my hair.

Frozenfire92 commented 10 years ago

That sounds like a good idea, I can do this right now

tehviking commented 10 years ago

Wow, you're more responsive on your repos than I am. Thanks so much!

On September 2, 2014 at 6:18:40 PM, Joel Kuntz (notifications@github.com) wrote:

That sounds like a good idea, I can do this right now

— Reply to this email directly or view it on GitHub.

Frozenfire92 commented 10 years ago

I modified the parser to say var date = moment.utc(self.get('date'));

Here?

tehviking commented 10 years ago

Yes, exactly. On September 2, 2014 at 6:22:27 PM, Joel Kuntz (notifications@github.com) wrote:

I modified the parser to say var date = moment.utc(self.get('date'));

Here?

— Reply to this email directly or view it on GitHub.

Frozenfire92 commented 10 years ago

Would you checkout https://github.com/Frozenfire92/ember-pikaday/tree/i004 and let me know if it works as you expect? You should be able to use the handlebars tag like you suggested

tehviking commented 10 years ago

I'll check it out tonight. Thanks again!

On Tuesday, September 2, 2014, Joel Kuntz notifications@github.com wrote:

Would you checkout https://github.com/Frozenfire92/ember-pikaday/tree/i004 and let me know if it works as you expect? You should be able to use the handlebars tag like you suggested

— Reply to this email directly or view it on GitHub https://github.com/Frozenfire92/ember-pikaday/issues/4#issuecomment-54233011 .

tehviking commented 10 years ago

This is awesome, thank you so much! :+1: :shipit:

Frozenfire92 commented 10 years ago

Awesome, sorry for the delay I will work on pushing this out asap. The new school year has slowed me down :laughing: