umts / pvta-multiplatform

Transit realtime app for mobile devices
Other
6 stars 5 forks source link

We don't round off secret seconds early enough #438

Closed dfaulken closed 6 years ago

dfaulken commented 7 years ago

screenshot_20170922-135318

It's weird to say that 1:54 PM is in both one and two minutes. Presumably this comes from the Avail side in the form of an EDT including seconds. Seems like we should round that off before using the estimation, to avoid this weirdness.

akaplo commented 7 years ago

Seems like we should round that off before using the estimation, to avoid this weirdness

By 'round that off', do you mean consistently round up (or down) before having momentjs format it? That's def the solution.

FWIW another way of stating the bug is as follows: Avail gives us times like this:

{
   sdt: 10:02:00
   edt: 10:02:59
}

When the current time is 10:00:00, moment will "round" and say that sdt is in 2 minutes and that edt is in 3, but we also show that they're both technically at 10:02.

mboneil10 commented 6 years ago

@jmchatton mentioned that it would be useful if sdt and edts in the past could include ago in the human readable time.

Look at the first departure in the expanded R10 section. The 5:55 time is in the past, and it's appropriately counting how many minutes ago that was. Is it possible to make it say 5 minutes ago rather than just 5 minutes so that it's a bit more specific?

screenshot_20171109-180031