- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
3.7 KiB
Timezone
What it is
WeKan stores every date in UTC and shows it in the time zone of the web browser that reads it. So when times look wrong, it is almost always the clock or the time zone of the server, the virtual machine or the computer of the browser that is off. This page is a checklist for getting those right, and says how WeKan itself turns a stored time into the time you see.
Read more
- Network Time Protocol,
Coordinated Universal Time
and the tz database (the IANA zone
names such as
Europe/Oslo) on Wikipedia. - WeKan pages: Board Settings / Date for the date format, and Friend.
How to use it
Make the clocks right.
-
At Windows, sync to ntp timeserver. Examples:
time.windows.comntp.ubuntu.comntp1.kolumbus.fi
-
Dual boot to Qubes OS. At desktop top right calendar/time, set timezone to Etc/UTC.
-
At server and its KVM VMs, edit
/etc/timezonetoEtc/UTC. -
Update time at server:
sudo apt -y install ntpdate sudo ntpdate ntp.ubuntu.com -
Now local time shows correctly at webbrowser, like for example at Friend Desktop Friend.
Testing other time related code. For testing any other time related code, that it shows correct local time, compare time functions results to this:
From Hogle Titlestad:
Oh, and the most important thing. The first argument is a time string. Seconds. Not a normal date. Such that you can subtracck and add seconds to it. So input would be:
this.parseDate( 1695981700956, false, 'Europe/Oslo' );e.g. Europe/Oslo is the server time zone. The timestamp is server time. For the event in question.
How the numbers are calculated
A stored date is a UTC instant. In the browser it is shown with the browser's
own zone (Date.getHours() and so on). Where a date is printed on the server,
for PDF and Excel exports, formatDateByUserPreference(date, format, includeTime, timeZone) in imports/lib/dateUtils.js
reads the year, month, day, hours and minutes in the given IANA zone with
Intl.DateTimeFormat (24-hour clock; an hour reported as 24 is shown as
00). The format is YYYY-MM-DD, DD-MM-YYYY or MM-DD-YYYY, with HH:MM
after it unless the format ends in -date-only. A zone the runtime does not
know falls back to the process's own zone.
How it works in WeKan
- A user profile has no time zone setting. For a server-rendered export the
browser sends its zone,
Intl.DateTimeFormat().resolvedOptions().timeZone(browserTimezone()in client/lib/exportLocale.js), together with the language and date format (#6586, "-2h wrong for Europe/Berlin"). - Without a zone the card PDF renders UTC and says
UTCafter the time (formatDateValue()in models/server/ExporterCardPDF.js), so the result does not depend on how the server was started. - Notification schedules have their own optional
timezone, checked withIntl.DateTimeFormatin models/lib/notificationDelivery.js.