lukevella / rallly

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
https://rallly.co
GNU Affero General Public License v3.0
3.55k stars 338 forks source link

Dates displaying different for different users #105

Closed terrance888 closed 2 years ago

terrance888 commented 2 years ago

For me, I put only mondays.

For my schedulers, I put only Sundays.

Needless to say, this is a bit wack Mine: unknown User 1: unknown User 2: unknown .

lukevella commented 2 years ago

Hi @terrance888, thanks for raising this. The issue here is that date values are stored in the database with timezone information that is determined by the machine of whoever created the event. This means people in different timezones can end up seeing different dates. Clearly an oversight from my end here and I apologize for that. I have already spent some time trying to fix this but at this point it might be better to simply fix this in the new version of Rallly which I'm currently working on and hopefully will be able to release very soon. Sorry if this issue caused you any trouble. I'll keep this issue open for now but I don't expect a fix for this in the current version.

terrance888 commented 2 years ago

Hi Luke,

Thanks for your response. It’s weird because the time zone difference involved is eastern time versus central time. Is there anything we can do on our side/user end for this to display correctly? Aka a workaround?

Thanks, Terrance

Sent from my iPhone

On Feb 8, 2022, at 11:12, Luke Vella @.***> wrote:

 Hi @terrance888, thanks for raising this. The issue here is that date values are stored in the database with timezone information that is determined by the machine of whoever created the event. This means people in different timezones can end up seeing different dates. Clearly an oversight from my end here and I apologize for that. I have already spent some time trying to fix this but at this point it might be better to simply fix this in the new version of Rallly which I'm currently working on and hopefully will be able to release very soon. Sorry if this issue caused you any trouble. I'll keep this issue open for now but I don't expect a fix for this in the current version.

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.

lukevella commented 2 years ago

I'm afraid other than setting your computers/devices to the timezone the event was created in there is not much else that can be done at the moment.

robertlong13 commented 2 years ago

@lukevella I'm pretty sure there is a one-line fix to this.

It appears that when the event is initially created, the dates are stored as midnight local time for the creator. This utterly breaks things if any participants are even one time-zone west of the creator. If you change this so that the datepicker creates the dates as noon local time instead, it will at least fix 99% of the problem. I think you can fix it in datepicker.directive.js

change

var today = Date.today(), activeDate = today.clone();

to

var today = new Date(Date.getYear(), Date.getMonth(), Date.getDay(), 12), activeDate = today.clone();

Of course, the correct thing to do would be to handle dates in a locale-agnostic fashion everywhere, but that's a little harder and I can't quite figure out how to do that (because I have zero experience with webapp development).

I was planning to test the above fix and open a pull request, but unfortunately, the build instructions are broken, and I don't have enough experience to figure out what's wrong there.

lukevella commented 2 years ago

The new version fixes this issue. Closing.