Giter Club home page Giter Club logo

Comments (8)

davwheat avatar davwheat commented on May 27, 2024 1

I think this one should be sorted now based on my testing while travelling in Europe this week.

from rail-announcements.

brodyFlannigan avatar brodyFlannigan commented on May 27, 2024

I'm having this issue too. I'm in Canada, on Eastern Standard Time.

What I'm seeing in the logs is that trains that are less than 4 minutes away are being marked as "more than 4 minutes away" since my system clock is 5 hours behind UK time.

This does appear to be a regression, as I was not having this issue previously (I can recall everything working properly about a month ago, but not sure of the exact date when the announcements stopped working.)

I will note that delay/cancellation announcements do work properly, just not the "Platform 1 for the 18:33 service to London Paddington..." announcements.

from rail-announcements.

davwheat avatar davwheat commented on May 27, 2024

Yeah, this is going to be because I moved to the staff departures endpoint of my API from the basic one. This has made my life A LOT easier with regards to getting proper date-time data for estimated arrival/departure, as well as separate arrival/departure times and the raw disruption data behind services.

The downside is that those date-time values don't have a timezone attached.

My understanding is that Huxley2 (the JSON-SOAP intermediary for Darwin data that I use) tries to be relatively transparent with the data it passes down, so adding the TZ there wouldn't be a great idea.

My other solution would have been to add it locally into API responses as part of the data parsing/filtering. This is probably better done with something like day.js rather than trying to use native JS APIs.

from rail-announcements.

davwheat avatar davwheat commented on May 27, 2024

https://github.com/davwheat/uk-dot-matrix/blob/6f1612f5185ae6b0d0f39b8a944154ad7d1e690a/src/components/displays/NewGTR/TrainServices.tsx#L16-L19

https://github.com/davwheat/uk-dot-matrix/blob/6f1612f5185ae6b0d0f39b8a944154ad7d1e690a/src/components/displays/NewGTR/TrainServices.tsx#L246-L254

This is how I'm trying to prevent this issue in the upcoming changes for my dot matrix board.

from rail-announcements.

davwheat avatar davwheat commented on May 27, 2024

I believe this should have been fixed during various changes I've made. Let me know if this happens again!

from rail-announcements.

Dionysusnu avatar Dionysusnu commented on May 27, 2024

When I currently visit https://railannouncements.co.uk/amey-live-train-announcements/, trains are still announced up to ~30 minutes ahead. I have tried reloading with CTRL+F5 to clear the cache, but the same behaviour remains.

Based on some local testing, it seems like
dayjs.tz.setDefault("Europe/London");
doesn't change the result of dayjs(s.etd), like in this case on line 1134; It is always interpreted in the local timezone.

This doc page suggests using dayjs.tz(s.etd, "Europe/London")

from rail-announcements.

davwheat avatar davwheat commented on May 27, 2024

But the docs do also say that setDefault should work: https://day.js.org/docs/en/timezone/set-default-timezone#docsNav

Do services also disappear off the departure board early too, or just get announced early?

from rail-announcements.

Dionysusnu avatar Dionysusnu commented on May 27, 2024

That page seems to talk specifically about the dayjs.tz constructor? So it sets the default for that, but not for dayjs() itself.
The departure board looks to be correct, though I've only looked at it now. I've not tested if it stays accurate when running for a longer time.

from rail-announcements.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.