camsys / onebusaway-nyc-atstop

21 stars 15 forks source link

Services: Replace DateTimeService and Moment with Humanize duration #16

Closed laidig closed 5 years ago

laidig commented 9 years ago

We have two libraries that deal with times and essentially serve the same purpose. Since the circular timer depends on humanize-duration, it's probably best to get rid of Moment and the DateTimeService, used on the AtStop page for showing predictions.

khfayzullaev commented 9 years ago

I would keep Moment.js for now.

As for the DateTimeService (https://github.com/camsys/onebusaway-nyc-atstop/blob/1b0443487ef5d47857bb745c300970ca20e71fc5/www/js/services.js#L624), we may re-write it to use HumanizeDuration.js.

Moment.js has a bunch of functions that should be written from scratch in JavaScript. And Moment.js is not the same as HumanizeDuration.js. The later one can be used primarily for converting inputs.

Moreover, we may need Moment.js later for Alerts.

laidig commented 9 years ago

Good point on Moment. I'm still irked about having two bits of code that do the same thing, though ;)

khfayzullaev commented 9 years ago

Yes, we should use HumanizeDuration.js for the following function https://github.com/camsys/onebusaway-nyc-atstop/blob/1b0443487ef5d47857bb745c300970ca20e71fc5/www/js/services.js#L626

khfayzullaev commented 5 years ago

Closing the issue because it has not had recent activity.