Feature Wiki
Tabs
Localization for Date Format
Page Overview
[Hide]1 Initial Problem
Generic problems:
- Currently, only few date formats are localized. That is, the individual date-format setting of the calendar is not respected by most of ILIAS. Instead ILIAS uses its own hard-coded format "DD. MMM YYYY" (e.g. 06. Oct 2016), which looks very weird in many regions - especially on certificates.
- The default date-format setting for new accounts is "DD.MM.YYYY" which is ok for Germany but apparently not for other regions. This default can not be changed.
- The date-format setting of a user can only be changed by the user or XML-Import, but not by administrators via GUI.
- Date format in Japanese “yyyy-mm-dd” is commonly used.
- "dd/mm/yy" causes confusion because they often feel like "yy/mm/dd"
- certificates > learner views > admin views
2 Conceptual Summary
- date-formats in certificates of courses, tests and learning modules will respect the calendar localization setting of the user
- the default date-format for new ILIAS account will be the international ISO-standardized date-format YYYY-MM-DD. System administrators can change the default date, possibly even early during setup.
- optional: administrators can change the date-format for existing users
- optional new guideline: user facing date-formats should respect the calendar setting
3 User Interface Modifications
3.1 List of Affected Views
- modified: Personal Settings
- rename: Date Input Format (Please choose a format for the input of dates.) -> Date Format (Please choose a format for the input and presentation of dates.)
- modified: certificates of courses, tests and learning modules
- modified: Administration > User Management > Settings > Standard Fields
- new entry: Date Format (with standard valued, which defaults to YYYY-MM-DD)
- modified: Administration > User Management > [Some User]
- new entry: Date Format
- modified: [Some Category] > Local User Management > [Some User]
- new entry: Date Format (if enabled for local administration)
3.2 User Interface Details
everything else is already explained in the list of affected views.
3.3 New User Interface Concepts
None
4 Technical Information
{The maintainer has to provide necessary technical information, e.g. dependencies on other ILIAS components, necessary modifications in general services/architecture, potential security or performance issues.}
5 Contact
- Author of the Request: initiated by Tamoto, Shiro [tamoto], extended by Kiegel, Colin [kiegel]
- Maintainer: {Please add your name before applying for an initial workshop or a Jour Fixe meeting.}
- Implementation of the feature is done by: {The maintainer must add the name of the implementing developer.}
6 Funding
If you are interest in funding this feature, please add your name and institution to this list.
- ...
7 Discussion
Dániel, Kiss-Kálmán [KissDani] 2016-03-31:
We use the 'yyyy-mm-dd' format, just as you in Japan. To tell the truth I don't believe if anyone in my country is interested in funding ;(
So I did some php modification in my installation (I know, I know it is far not the best, I'm clear with it's disadvantages):
--------------------
Services/Calendar/classes/class.ilDatePresentation.php
~ line 150:
------------include_once('./Services/Calendar/classes/class.ilCalendarUtil.php');
/* old $date_str = $date->get(IL_CAL_FKT_DATE,'d').'. '.
ilCalendarUtil::_numericMonthToString($date_info['mon'],false).' '.
$date_info['year'];*/
$date_str = $date_info['year'].'. '.
ilCalendarUtil::_numericMonthToString($date_info['mon'],false).' '.
$date->get(IL_CAL_FKT_DATE,'d');
--------------------
Services/Utilities/classes/class.ilUtils.php
~ line 999:
------------/* old $dateformat = "d-m-Y";*/
$dateformat = "Y-m-d";
---------------------------
These 2 modifications solve all the 5 pages (and many others).
Calendar is a far different story.
You need to modify Services/Calendar/classes/class.ilCalendarSOMETHINGGUI.php files.
---------------------------------
If you are looking for a user-dependent solution, take look at line 367 in class.ilCalendarMonthGUI.phpswitch($this->user_settings->getTimeFormat()....
You can do something like that, but use getDateFormat()
-------------------------
Without doubt an official solution would be far better, hope it comes a day ;)
Regards, Daniel
Neumann, Fred [fneumann], November 10, 2016:
That could be part of a broader Internationalisation support. It would help to look for examples or libraries from other development frameworks that can be re-used.
8 Implementation
{The maintainer has to give a description of the final implementation and add screenshots if possible.}
Test Cases
Test cases completed at {date} by {user}
- {Test case number linked to Testrail} : {test case title}
Approval
Approved at {date} by {user}.
Last edited: 10. Nov 2016, 11:54, Neumann, Fred [fneumann]