Upcoming cards logic seems to rely on UTC time instead of adjusting for timezone
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Describe the bug It's currently just past 10am EST, the card is due at 8pm today (relative time was calculated correctly), however, the card is shown as scheduled for tomorrow. Furthermore, in Tasks, the same card is reporting as due for it's UTC equivalent (Tomorrow 1am).
Client timezone: EST VM timezone: UTC/EST (same behaviour with either) Environmental variable: EST
To Reproduce Steps to reproduce the behavior:
- Change timezone to something other than UTC
- Create a card that is due today in local time but tomorrow in UTC
- Open "Upcoming cards" page
- The card is listed as due tomorrow
Expected behavior The card is listed as due today
Screenshots
Client details:
- OS: Windows 10
- Browser: Chrome
- Version: Deck 1.11.3
- Device: Desktop PC
Server details
Operating system: Ubuntu Server 22.04 LTS (Using the official Docker images) Web server: Nextcloud Apache
Database: PostgreSQL 15.5 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
PHP version: 8.1.25
Nextcloud version: 27.1.4
Where did you install Nextcloud from: Docker Hub
Signing status:
List of activated apps:
Nextcloud configuration:
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
Logs
Nextcloud log (data/nextcloud.log)
Browser log
The cards in the overview view are sorted into columns here https://github.com/nextcloud/deck/blob/bfe2a9053f4d54d5c6b64f6822fabf5143a555ac/lib/Service/OverviewService.php#L88-L106
$diffDays is determined by this function
https://github.com/nextcloud/deck/blob/bfe2a9053f4d54d5c6b64f6822fabf5143a555ac/lib/Db/Card.php#L173-L186
the $duedate is at UTC, therefore it's not possible to reliably check if it's due the current day.
A way to fix this is either by offsetting the duedate by the server timezone or by moving the calculation to the frontend. Moving it to the fronted will better reflect the actual meaning of "days until due" as users in a different timezone don't use the timezone the server is in but rather their local time.