Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poll shows wrong time on the day of daylight saving change #211

Closed
dartcafe opened this issue Oct 23, 2017 · 17 comments
Closed

Poll shows wrong time on the day of daylight saving change #211

dartcafe opened this issue Oct 23, 2017 · 17 comments
Assignees
Labels

Comments

@dartcafe
Copy link
Collaborator

Polls show the wrong time in the poll, on the day, the day light saving changes.

  1. Create a date poll with an option on 2017 October 29th 9:00
  2. The poll shows an option for 2017 October 29th 8:00

All other dates (28th and 30th for example) are interpreting the time zone correct.

@dartcafe dartcafe added this to the 0.8.1 milestone Oct 23, 2017
@dartcafe dartcafe self-assigned this Oct 23, 2017
@dartcafe
Copy link
Collaborator Author

Note to @dartcafe
Short analysis:

  • The calculated time in the vote page is correct referring the stored time (from Oct. 29th on time in Europe is UTC+1).
  • The stored time seems to not respect the ending of daylight saving on Oct 29th.
  • Behavior is correct before Oct 29th (UTC+2) and after it (UTC+1).

Reproduce Poll with following options:
28.10.2017 07:30 -> DB value '2017-10-28 05:30' ✅ -> vote page: Okt, 28, 07:30:00 (UTC +2) ✅
29.10.2017 07:30 -> DB value '2017-10-28 05:30' ❌ -> vote page: Okt, 29, 06:30:00 (UTC +1) ✅
30.10.2017 07:30 -< DB value '2017-10-30 06:30' ✅ -> vote page: Okt, 30, 07:30:00 (UTC +1) ✅

Need to investigate on writing the UTC time. There seems to be an error on writing the selected vote time to the db.

@v1r0x
Copy link
Collaborator

v1r0x commented Oct 23, 2017

Need to investigate on writing the UTC time. There seems to be an error on writing the selected vote time to the db.

@dartcafe Isn't the UTC time written to the DB?

@dartcafe
Copy link
Collaborator Author

Yes. But it seems, that the time is assumed to be UTC+2, but it is UTC+1 from Oct 29th on.
See https://nc13.yagst.de/index.php/apps/polls/poll/b8oIJNNjpx7Rkyei

@v1r0x
Copy link
Collaborator

v1r0x commented Oct 23, 2017

https://github.com/nextcloud/polls/blob/master/lib/Controller/PageController.php#L478 is the line where it's added to the db. I'll have a look at phps date function and how $el is formatted tomorrow.

@v1r0x
Copy link
Collaborator

v1r0x commented Nov 4, 2017

I had a look at the timestamps coming from JS (the values in $el) and they are wrong. I think this is a bug in the datepicker lib. I also tried the latest version (2.5.11) and it doesn't work.

@dartcafe
Copy link
Collaborator Author

dartcafe commented Nov 4, 2017

Hmmm. I would say, overwork to the create page should be the next project. So we can use another date picker and another way to build more flexible poll options. The problem will occur next time in march. Until then, we have time. 🤣

@v1r0x
Copy link
Collaborator

v1r0x commented Nov 4, 2017

I thought about switching to a js framework. But I only know how to use Angular1 which is rather old.
Maybe vue.js is worth looking at. Would save us a lot of js code and overall complexity.

@dartcafe
Copy link
Collaborator Author

dartcafe commented Nov 5, 2017

We should use the core timepicker. Makes it more unique for the user and it is build in. See: nextcloud/server#6348 and recent related issues.

@v1r0x
Copy link
Collaborator

v1r0x commented Nov 5, 2017

Yes, as soon as it is available. If it is something that should be fixed before the new NC datetimepicker (NC 14 I think), it should be passed over to the current datetimepicker lib.

@splitt3r
Copy link
Contributor

splitt3r commented Nov 6, 2017

+1 for using vue.js! I also thought about having a look at it.

@v1r0x
Copy link
Collaborator

v1r0x commented Nov 6, 2017

I'd suggest to switch (on a dev branch) to vue.js after @dartcafe has finished the UI improvements.

@BurtGummer
Copy link

I have almost the same problem with the time. I create a poll around 09:59, but the comments show times 09:05 and 09:10 ...

@jgrete
Copy link

jgrete commented Nov 16, 2017

Another date problem: choosing an expiration date X days from now results in an expiration date X days BEFORE now.
Example: Current day 16th of november. Choose 19th of november as expiration date and you'll get
"expired since 3 days". Maybe it is just a misplaced sign within the date calculation or a method call with interchanged arguments or a wrong translation ??

@v1r0x
Copy link
Collaborator

v1r0x commented Nov 16, 2017

@jgrete You talk about the label displayed in the UI, not the date stored in the DB? The wrong translation is fixed in NC 13 (I think), but I don't know if it's available in NC 12 as well. @dartcafe can give more information (hopefully 😉 )

@jgrete
Copy link

jgrete commented Nov 16, 2017

@v1r0x Ok, I'll wait until tomorrow. If it's only the translation the absolute value will decrease, if not increase

@dartcafe
Copy link
Collaborator Author

See here: nextcloud/server#6897, nextcloud/server#6896 and
nextcloud/server#6837 are already merged to corresponding branch. You have to wait for the releases.

@dartcafe dartcafe modified the milestones: 0.8.1, 0.9.0 Dec 14, 2017
@dartcafe dartcafe modified the milestones: 0.9.0, 0.9.1 Sep 15, 2018
@dartcafe dartcafe modified the milestones: 0.9.2, 0.9.3 Dec 16, 2018
@dartcafe dartcafe removed this from the 0.10.0 milestone Feb 10, 2019
@dartcafe
Copy link
Collaborator Author

No further investigation, since this appears to happen only twice a year. No chance of reproduction right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants