Bug 410490 - Resource bundle dates don’t follow user’s regional settings for display (and are incorrectly encoded)
Summary: Resource bundle dates don’t follow user’s regional settings for display (and ...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Resource Management (show other bugs)
Version: git master (please specify the git hash!)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-01 17:46 UTC by Karl Ove Hufthammer
Modified: 2019-08-02 12:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Ove Hufthammer 2019-08-01 17:46:54 UTC
SUMMARY
In the resource bundle dialogue, the ‘Created’ and ‘Updated’ dates are always shown in the DD/MM/YYYY format, instead of the user’s preferred date format. Besides looking strange for users not used to this format (e.g. American users), it’s often ambiguous (is 01/08/2019 the August 1 or January 8?).

Also, in the actual resource bundle file, meta.xml, the dates are stored in this format:

 <meta:creation-date>01/08/2019</meta:creation-date>
 <meta:dc-date>01/08/2019</meta:dc-date>
 
But these are invalid values, since the bundle file uses the OpenDocument schema. The ‘meta:creation-date’ and ‘meta:dc-date’ must be (according to https://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415108_253892949) of the data type ‘dateTime’. This format is defined in https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#dateTime. An example of a valid ‘dateTime’ is ‘2002-10-10T12:00:00-05:00’ (noon on 10 October 2002, Central Daylight Savings Time as well as Eastern Standard Time in the U.S.).


STEPS TO REPRODUCE
1. Ensure you have a regional settings (e.g. in KDE or Windows) with a date format different than DD/MM/YYYY.
2. Go to ‘Settings → Manage Resources’.
3. Click an active bundle.
4. Click ‘Open Resource Bundle’, navigate to the ‘bundles’ folder, unzip a bundle file and take a look into the ‘meta.xml’ file.


OBSERVED RESULT
In step 3: The ‘Created:’ and ‘Updated:’ fields for the chosen bundle is shown as date in the DD/MM/YYYY format (e.g. ‘24/12/2018’).

In step 4: The ‘meta:creation-date’ and ‘meta:dc-date’ elements are encoded in the DD/MM/YYYY format.


EXPECTED RESULT
In step 3: The ‘Created:’ and ‘Updated:’ fields for the chosen bundle should be shown in the user’s preferred date or datetime format.

In step 4: The ‘meta:creation-date’ and ‘meta:dc-date’ elements should be stored in the ‘dateTime’ format defined in https://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#dateTime


SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20190726
KDE Plasma Version: 5.16.3
KDE Frameworks Version: 5.60.0
Qt Version: 5.13.0
Kernel Version: 5.2.2-1-default


ADDITIONAL INFORMATION
It’s best if the datetimes are stored *with a timezone* (either the user’s, or UTC/‘Zulu’, e.g. ‘2000-03-04T20:00:00Z’), since only then is the actual point in time defined.

Also note that, when *displaying* the datetime, the date displayed is *not* necessary equal to the 10 first characters in the the datetime string, since it depends on the *user’s* timezone (so the date shown may be one day before/after). But Qt should handle all this automatically.
Comment 1 wolthera 2019-08-02 10:33:15 UTC
Git commit 7fb302012a1ed54f9957d1549e71d86e8e3420ae by Wolthera van Hövell tot Westerflier.
Committed on 02/08/2019 at 10:33.
Pushed by woltherav into branch 'master'.

This will allow for the date to be displayed as a localized format.

For bundles using the old format, Krita will convert these appropriately.

M  +2    -2    libs/ui/KisResourceBundle.cpp
M  +10   -2    plugins/extensions/resourcemanager/dlg_bundle_manager.cpp
M  +1    -1    plugins/extensions/resourcemanager/resourcemanager.cpp

https://invent.kde.org/kde/krita/commit/7fb302012a1ed54f9957d1549e71d86e8e3420ae
Comment 2 Halla Rempt 2019-08-02 12:13:11 UTC
Git commit b582ead9ecf83a331f8c39b24dd47bd4e60f881d by Boudewijn Rempt, on behalf of Wolthera van Hövell tot Westerflier.
Committed on 02/08/2019 at 12:12.
Pushed by rempt into branch 'krita/4.2'.

This will allow for the date to be displayed as a localized format.

For bundles using the old format, Krita will convert these appropriately.

M  +2    -2    libs/ui/KisResourceBundle.cpp
M  +10   -2    plugins/extensions/resourcemanager/dlg_bundle_manager.cpp
M  +1    -1    plugins/extensions/resourcemanager/resourcemanager.cpp

https://invent.kde.org/kde/krita/commit/b582ead9ecf83a331f8c39b24dd47bd4e60f881d