-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Description
CKAN version
2.10, 2.11, and master
Describe the bug
In the ckan/public/base/javascript/main.js and the ckan/public-midnight-blue/base/javascript/main.js (2.11), when loading the Moment.js, the names of Chinese locales should be zh-tw and zh-cn (rather than zh_Hant_TW and zh_Hans_CN from the locale variable), or they will not be loaded successfully under the corresponding locales:
// Convert all datetimes to the users timezone
jQuery('.automatic-local-datetime').each(function() {
moment.locale(locale);
var date = moment(jQuery(this).data('datetime'));
if (date.isValid()) {
jQuery(this).html(date.format("LL, LT ([UTC]Z)"));
}
jQuery(this).show();
})Steps to reproduce
This issue affects:
- The timestamp fields in the DataTables view.
- The local_friendly_datetime snippet.
Expected behavior
The Chinese locales should be loaded without problems.
Additional details
The Additional Info section on the dataset page provides a quick way to confirm the results of the fix.
A fix similar to #8432 should be able to resolve this bug. I will submit a PR later.
Metadata
Metadata
Assignees
Labels
No labels