Anniversaries: date off by one

I was very pleased this morning to see that it’s my cakeday (on the forum I administer):

And out of curiosity I went to see who else’s cakeday was nearby. Strangely, though, the anniversaries page seems to be a day in the past:

Could it be because I’m in GMT+8?

5 Mi Piace

That’s what I think.

Given that Discourse localizes the times it shows you everywhere else in the UI, I feel this is still a “bug” and should be fixed.

3 Mi Piace

So there are 24+ different cake day sets? That seems crazy.

That’s one way to look at it I guess. But I’m assuming the users are queried on page load, so there’s really only “one” set at a time.

Here’s a better example. The post you just made shows up for me as “June 8, 2017 12:45 AM”. If I was to fly across the country to California, I’d expect that post to show as “June 7, 2017 9:45 PM”.

1 Mi Piace

…and I just earned the “anniversary” badge this morning. This does feel like a bug to me.

Could it be mitigated by simply changing the timezone of the server to something more applicable for my community? We’re (mainly) in Australia, so processing everything as, say, GMT+8 or GMT+10 would make this all feel less odd.

Not a major issue, of course. :wink:

Since the server doesn’t know a user’s time zone, maybe the easiest fix for this would be to award the badge one day later? For some, that will mean they get it late, but that will probably not be experienced as a bug as much as an early award is.

Another option might be to simply specify in the UI that these times are based on the server’s time zone.

1 Mi Piace

Penso che nel contesto di una comunità fortemente localizzata si dovrebbe poter specificare il fuso orario per il “cakeday” di Discourse. Cambiare il fuso orario del server non è davvero qualcosa che possiamo fare.

È una questione delicata e non sono sicuro di come risolverla, anche ora che permettiamo agli utenti di specificare i “fusi orari”.

Se ti sei iscritto a un forum in Australia il 2 gennaio 2019 alle 8:00:

  • Il tuo anniversario di un anno secondo il “cakeday” sarà il 1° gennaio 2020.

  • Quando visiti la pagina degli anniversari alle 8:00 del 2 gennaio, vedrai gli anniversari del 1° gennaio 2020 invece del 2.

Credo che ciò che stiamo chiedendo qui sia di utilizzare i fusi orari “locali” definiti negli utenti per tenere conto di questi aspetti.

Cioè:

  • Il tuo anniversario di un anno dovrebbe essere il 2 gennaio 2020 perché il tuo fuso orario locale nel profilo utente è l’Australia.

  • Quando visiti la pagina degli anniversari il 2, dovresti vedere il 2.


Per ora penso che sostenga la soluzione più semplice: quando si visualizza la pagina degli anniversari, controllare il fuso orario locale dell’utente corrente e utilizzare quella data invece della data UTC attuale, nei casi in cui un utente è connesso. Dovrebbe essere una modifica piuttosto semplice, forse due righe di codice.

@techAPJ puoi occupartene?

8 Mi Piace

Credo che @tgxworld abbia già risolto il problema per tenere conto dello sfasamento orario tramite:

e

MODIFICA: Sono nel fuso orario UTC+5:30 ma ho uno sfasamento di 6 ore, quindi sto notando alcuni casi limite per gli utenti che hanno creato l’account tra le 23:30 e le 00:00. Sto indagando.

6 Mi Piace

Risolto tramite:

8 Mi Piace