Change option's time handling and add timezones#4437
Conversation
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
|
This is definitely a big improvement, thank you! One comment: I would recommend that the guest/visitor could choose to view it in the poll creator's / original timezone. This will remove confusion as to what was the intent of the poll creator, which I think is the main issue today. The behaviour seems to be the opposite in the screenshots. I understand New York is the poll creator's time zone, Berlin is the guest's time zone. I would suggest to switch the behaviour so that if I, as guest, click "original time zone" I see the poll as the creator made it (e.g. as if I am in New York). So I would see "23 January" only when selecting "original time zone". And if I switch to Berlin, I would see the Berlin times. A different note on UX, perhaps for next change: Other tools, for example Doodle, just ignores the time zone for full day events. If I create an all-day event in UTC 0 (Iceland), then it does not matter what time zone I select as a guest, it always displays the full day event as if I was in Iceland. Check here: https://doodle.com/group-poll/participate/e50qBgXd/vote But time specific events are moved to the corresponding date. Screenshots below. Thanks again for the good work π
|
Signed-off-by: dartcafe <github@dartcafe.de>
|
Great work, thanks for implementing this β€οΈ I haven't really used polls for quite some time, but since I participated in the discussions intensively back then I felt the obligation to at least give it a try. The PR code runs without any issue (but I didn't do a code review), here are a few more suggestions (which can also be ignored since I'm basically a non-user):
|
That is, how it works. In the example, New York ist the poll's timezone, defined by the owner. Berlin is the visitors (local) timezone. The pictures may be confusing due to the shifted dates of the "original" timezone. I simply did not adjust the dates so that they match in a plausible way.
I was thinking about it but it may have some issues, if the visitor sits far away (i.e. 12 timezones away). If the date is i.e. 2026-01-18, what does that mean for the visitor? Which day may be meant from his perspective. 2026-01-17, 2026-01-18 or 2026-01-19, depending of the direction (+12 or -12 hours)? This may be more confusing. Most of the times the polls will show no timezone information, because owner and participants will reside within the same timezone. I believe, that selecting the timezone in case of different timezones between visitor and owner is the most transparent information. And to be honest, adding options with a particular timezone is still not done yet. |
π Thanks for taking the time for testing. Be aware, that adding options inside a particulair timezone is still WIP.
Yes I am thinking about something like this, and try to fiddle out a good and working method. What keeps me from this for the moment is the migration. We have to be very very careful about it to avoid breaking existing polls. Currently the backend is not fully clean and needs a lot of polish. Fallbacks are needed as removing obsolete code.
I guess this will be possible out of the box after the PR is finished.
I stores the options for a textpoll and a readable ISO like interval. Additionally it is a key for indices and for matching votes to an option. And yes, it is UTC here.
I plan to make this optional, so a poll owner can decide, which timezone should be used as default for a visitor.
Yes. Currently WIP, see comments before. The UI needs some tries to make it usable. In the end, both timezones will be displayed and also the timezone for the date-time selector should be selectable (Proposals of visitors in mind). |
|
Thank you guys for this immediate responses. Helps a lot. |
I understand what you mean, and I think the case of +12 / -12 hours is sort of an edge case, as we tend to have meetings more rarely with people who are further away - and +/- 12h is always the furthest away it's possible to get :) I believe the full-day event is used most often when time zone differences are smaller (e.g. 1h or 2h), but even 1h difference in time zone causes confusion with the current UX as the event then appears to be spanning multiple dates. So I think this is why Doodle have opted for keeping full-day events without time, and letting the user figure out which date is referred to using the context of the poll if there is any doubt (who created it, for example). As in the absolute majority of the cases, it will be obvious to the user what date is meant. My 2 cents on this point is to allow the potential confusion of the +/- 12h time difference and prioritise the more common user experience of scheduling full-day events. |
|
The timezone difference between Moscow and New York counts 8 hours. Now imagine Trump wants to meet Putin and they miss each other because of misinterpreting the day. π I think I understand the issue completely. I am absolutely sure, the majority of meeting organization happens within the same timezone. But I want to make sure, this works under any circumstances. This means for a whole day event:
The first solution will fit into the current scheme of Polls, how it handles dates and times. And it fits to exiting polls and just extends but does not change them. The second one can be a further optimization, but needs more time and coding and testing and migration. BTW: With the planned option of setting the poll owner's timezone as the default should avoid the confusion too at first hand. And also thanks for participation in the discussion and adding your feedback. Valuable!!! |
|
Ah, thank you for pointing out that the poll creator's time zone will be the default one (and not the visitor's browser for example). That will resolve the current UX confusion I think, as (I believe) most people won't change the time zone for polls with only full day events. ππ |
Signed-off-by: dartcafe <github@dartcafe.de>
|
Adding options to a poll with flexible timezones was pushed. |
Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 5 to 6. - [Release notes](https://github.com/dessant/lock-threads/releases) - [Changelog](https://github.com/dessant/lock-threads/blob/main/CHANGELOG.md) - [Commits](dessant/lock-threads@v5...v6) Signed-off-by: dartcafe <github@dartcafe.de> --- updated-dependencies: - dependency-name: dessant/lock-threads dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [vue](https://github.com/vuejs/core) from 3.5.25 to 3.5.26. - [Release notes](https://github.com/vuejs/core/releases) - [Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md) - [Commits](vuejs/core@v3.5.25...v3.5.26) Signed-off-by: dartcafe <github@dartcafe.de> --- updated-dependencies: - dependency-name: vue dependency-version: 3.5.26 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [baseline-browser-mapping](https://github.com/web-platform-dx/baseline-browser-mapping) from 2.9.10 to 2.9.11. - [Release notes](https://github.com/web-platform-dx/baseline-browser-mapping/releases) - [Commits](web-platform-dx/baseline-browser-mapping@v2.9.10...v2.9.11) Signed-off-by: dartcafe <github@dartcafe.de> --- updated-dependencies: - dependency-name: baseline-browser-mapping dependency-version: 2.9.11 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Bumps [qs](https://github.com/ljharb/qs) from 6.14.0 to 6.14.1. - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](ljharb/qs@v6.14.0...v6.14.1) Signed-off-by: dartcafe <github@dartcafe.de> --- updated-dependencies: - dependency-name: qs dependency-version: 6.14.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 7.3.0 to 7.3.1. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v7.3.1/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v7.3.1/packages/vite) Signed-off-by: dartcafe <github@dartcafe.de> --- updated-dependencies: - dependency-name: vite dependency-version: 7.3.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [baseline-browser-mapping](https://github.com/web-platform-dx/baseline-browser-mapping) from 2.9.11 to 2.9.12. - [Release notes](https://github.com/web-platform-dx/baseline-browser-mapping/releases) - [Commits](web-platform-dx/baseline-browser-mapping@v2.9.11...v2.9.12) Signed-off-by: dartcafe <github@dartcafe.de> --- updated-dependencies: - dependency-name: baseline-browser-mapping dependency-version: 2.9.12 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
β¦d fields by Nextcloud Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
Signed-off-by: dartcafe <github@dartcafe.de>
|
This took more time than expected, but I hope finally it is done.
This had more side effects and caveats than I was ready for. π¬ If anyone will give the beta a try and wants to roll back afterwards, just install the last release and
So @andreas-1107 and @PhrozenByte or anyone else: If you could give it a try and smoke test the beta (from the appstore or from the releases page) ... v9.0.0-beta.2 will be out today. Since Nextcloud 31 is out of maintenance, this feature will mark the 9.0.0 milestone and Support of PHP 8.1 is also dropped. Although not explicitly tested, PHP 8.5 should work, too. This PR will get merged soon, so please report any issues in a new issue. |
|
Great work, thanks @dartcafe! β€οΈ I tested with the current PR (fresh install from sources) and noticed the following 8 things (some suggestions, some bugs, and one note). I wasn't sure how to report this, so I decided to tell it like a step-by-step reproducer, I hope you can follow what I was doing: Step 1 Let's assume I'm in "Europe/Berlin" and want to create a poll with "America/New York". I thus select "America/New York" as the poll's default timezone first. I then open the options modal. The defaults are: "Whole day" enabled, "2026-03-03" (i.e., today), timezone "Europe/Berlin" and a duration of "0 days".
1. Suggestion: I'd recommend selecting the poll's default timezone by default here instead of the user's timezone. 2. Suggestion: I'd recommend using "1 days" as default duration. Adding that option creates a 3. Bug: Why does the default "0 days" duration create an option with Step 2 I reload the page and open the options modal again, but select "2026-03-04" (i.e., tomorrow) instead. I additionally choose timezone "America/New York" and a "1 day" duration, so
Adding that option creates a Step 3 I reload the page and open the options modal again. Default timezone is "Europe/Berlin" again. I select "2025-03-05" and disable "Whole day". The time defaults to "18:15" (which is the current local time). I also keep the default "0 days" duration.
4. Suggestion: In addition to the first suggestion above, Adding that option creates a 5. Note: I'd say that's expected since "0 days" was the default duration, even though I recommend changing that to "1 day", or maybe "1 hour" when the "Whole day" option is disabled. However, note that "0 days" now behaves different than before: With "Whole day" enabled it is interpreted like "1 days", but with "Whole day" disabled it's interpreted like the literal "0 days". 6. Bug: This just added option isn't displayed properly, simply no option text is shown:
Step 4 I reload the page and open the options modal again. I select "2026-03-06" and timezone "America/New York". I disable "Whole day", the time now defaults to "00:30". I keep the default "0 days" duration. However, the preview was totally unexpected and super confusing at first:
7. Bug: Why is the default time "00:30"? It's 18:30 in my local "Europe/Berlin" timezone, which equals 12:30 in the selected "America/New York" timezone. The issue might be related to the following: 8. Bug: Adding that option creates a Step 5 I reload the page and open the options modal again. I select "2026-03-07" and timezone "America/New York". I disable "Whole day", manually enter a time of "12:00" and select a "1 hour" duration. Naturally the same issues as in step 4 apply:
Adding that option creates a Other notes
|
Step 3Zero day|month|hours|...As stated above, this does not select "whole day", so a zero duration means a single moment in time and therefore this option actually has no duration in contrast to the term "whole day" which represents a span by definition.
It is literally zero duration, no matter, which unit is selected. The missing text has to be a bug indeed. I will check that! |
Step 4 and 5timezone mismatchDamn, I had this on time but could not reproduce that. I thought, I did not look correctly or it was because of the dev environment. Here the timezone seems not to be correctly applied to the display. The main information should show the chosen timezone. The other timezone is added as information. In you screenshot it is displayed the wrong way. Have to check and fix this. |
That's only relevant for the dev environment, but indeed outdated, have to refresh that. As well as bringing back PHP 8.1 as supported version. |
|
Again, thanks for the support. |
Yes. That's the week point in this. But this has been before and therefore will sty for the moment. Solving every edge case now will complicate things and delay the release. As I said in another Thread: This subject of change later.
This also. With the current logic the value will be change, from zero to 1, is someone activates the "whole day" option. And the 1 will stay even if the user switches back. This is a minor UX issue, which will be solved separately as well as the whole day issue. The main focus is not to alter existing polls. The changes can affect the outcome of existing polls. And this was tough enough. |
Alright, fair enough, totally up to you, as I said. I just want to recommend removing "Closes #2368" from the list of issues this PR closes then - that's the existing issue tracking that particular feature π
I'm not sure whether we're talking about the same thing here π π I'm really just talking about the UI here, not the backend. Because, in my tests, if I open the options modal, the pre-selected default duration is "0 days". If I now disable "Whole day", it stays at "0 days". If I enable "Whole day" again, it still is "0 days". What I'm suggesting is just that instead of pre-selecting "0 days" in the UI, it should pre-select "1 days" by default. If an user then disables "Whole day", that default "1 days" should automatically change to "1 hours". If an user enables "Whole day" again, it should switch back to "1 days" by default. That's it. No backend changes. It's really just about the UI here when adding new options, not what the backend is doing with these values later (like, treating "0 days" like "1 days" if "Whole day" is enabled - that's a whole different topic, that's why I separated them earlier). So, assuming you indeed change the default in the UI to "1 days" with "Whole day" enabled and an user manually changes that to "0 days", it still is treated the same by the backend. Just wanted to clarify. If you still don't think that's an improvement: Fair enough, as I said, totally up to you π |











may be reverted
closes #4045
closes #3700
closes #2368
closes #2851
closes #3699
Timezone selection is only available in date polls and if the polls's original timezone does NOT match the local timezone.
To dos:
Affects options and votes:
Usage of timestamps have been replaced by DateTimeImmutable.
Duration in seconds has been replaced by DateInterval.
To avoid migrations now, the db will still receive timestamps and duration values in seconds, but also ISO formatted strings representing the option's timestamp and duration. API got extended by the ISO values.
ISO always values get precedence over their numeric sibling, either from the values read from the database or when set using the API.