MMM-LocalTransport icon indicating copy to clipboard operation
MMM-LocalTransport copied to clipboard

Comparison error for overnight arrivals.

Open Ybbet opened this issue 5 years ago • 0 comments

First of all, thank you for this module! I use it a lot on my installation.

I noticed, that said, a bug on the next trains leaving after midnight. Indeed, the script compares the departure time with respect to now. But do not take into account if it's in the future. As a result, it displays "X minutes ago".

Example: It is 22h. The train service is over for today. As a result, the next train is at 5am the next day. Instead of displaying "In 7h", it displays "17h ago".

It may be necessary to make a comparison of the departure date with the current time at this line of the script: https://github.com/CFenner/MMM-LocalTransport/blob/master/MMM-LocalTransport.js# L86

Ybbet avatar Aug 26 '18 10:08 Ybbet