Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Fix date time math comparison #6

Closed
qwo opened this issue Nov 5, 2014 · 5 comments
Closed

Fix date time math comparison #6

qwo opened this issue Nov 5, 2014 · 5 comments
Labels

Comments

@qwo
Copy link
Member

qwo commented Nov 5, 2014

This breaks every time daytime changes.

see https://github.com/Code4HR/hrt-bus-text-my-bus/blob/master/app.js#L116-119 for where a refactor could be useful.

I hacked together the date time parsing and diffing because Moment nor DateString was not working.

@qwo qwo added the bug label Nov 5, 2014
@ghost
Copy link

ghost commented Nov 8, 2014

Looking at this right now, what time format does the HRT bus API send out? UTC? Which time zone?

@qwo
Copy link
Member Author

qwo commented Nov 9, 2014

see the api. http://api.hrtb.us/api/stop_times/8004/ Looks like UTC GMT

On Sat, Nov 8, 2014 at 6:50 PM, Ryan Y. [email protected] wrote:

Looking at this right now, what time format does the HRT bus API send out?
UTC? Which time zone?


Reply to this email directly or view it on GitHub
#6 (comment)
.

Stanley Zheng

@ghost
Copy link

ghost commented Nov 9, 2014

It breaks every time daytime changes? Do you mean when it switches from day to day?

@qwo
Copy link
Member Author

qwo commented Nov 9, 2014

It breaks conditionally annually(?) ex: when it was date light savings time the app was off by a hour.

theres an issue with momentum handling the date times from hrtb.us and i manually parse the times from GMT to EST by manually subtracting 4-5 hours. (240-300 minutes).

this is really brittle and could be improved if momentum was utilized correctly to parse the date response from the server and then used the date.diff function in momentum for date comparisons.

@ghost
Copy link

ghost commented Nov 9, 2014

Fixed as of 1dc7f27.

@ghost ghost closed this as completed Nov 9, 2014
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant