DigitaleGesellschaft / jekyll-theme-conference

Jekyll template for a conference website containing program, speaker, talks and room overview
MIT License
64 stars 59 forks source link

Taking time zone into account #31

Closed julien-arino closed 1 year ago

julien-arino commented 1 year ago

This is a little last minute because I just ran into this issue when the conference started.. In _config.yml, there is a timezone variable, but as far as a I can tell, it is not used anywhere. Anyone has an idea for a quick fix to use it, because right now I have live tags appearing in GMT, but I am GMT-5, so the talks showing as currently live are afternoon talks when it is morning here.. I am guessing that's in one of the _includes/partials/get_ or show_, but my liquid is still a bit shaky and I don't see where this goes.

lorenzschmid commented 1 year ago

Ouh no, that is annoying, I am sorry. So far we never had any issue with the live tags but indeed, the timezone variable is not used.

As a very quick fix try to modify the local code of your gem, i.e. inside vendor/bundle/ruby/3.2.0/gems/jekyll-theme-conference-3.6.3/. Best is probably to adapt the timeNow function inside _includes/js/live.js like the following:

    const timeNow = () => {
        // Current timestamp in seconds
        return Math.floor(Date.now() / 1000 - 5*60*60);
    };

Unfortunately, I will be offline for the next few hours but I hope this helps. I will look into it at a later point in more detail. Sorry again for the inconvenience and thanks for reporting it. Alternatively, you can of course also disable the live feature.

julien-arino commented 1 year ago

Your suggestion (edit timeNow) works fine, thanks for the prompt answer!!!

[Edit] As far as this question goes, I think this is solved. It would indeed be nice to incorporate use of the timezone explicitly in the code, but with this issue description here and the solution you provide, this provides a completely workable fix (I don't think a given conference organiser will need to change this more than once).

lorenzschmid commented 1 year ago

Glad, the quick fix helped. And thanks, I opened a new issue for it in #32