View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0023578 | mantisbt | documentation | public | 2017-11-02 03:51 | 2017-12-06 05:01 |
Reporter | naib | Assigned To | dregad | ||
Priority | normal | Severity | text | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.7.1 | ||||
Target Version | 2.9.0 | Fixed in Version | 2.9.0 | ||
Summary | 0023578: Document need for consistency between "normal" and "datepicker" date formats | ||||
Description | Original issue summary: Odd display in project version date after upgrading from 1.1.2 -> 1.3.12 -> 2.7.1 In my installation, after following the upgrade path noted above, if I attempt to edit the Date Order value, I notice that it is formatted in an odd way, and looking at the HTML, the date picker seems to be using the value attribute as a literal value for the data-picker-format to format. <input id="proj-version-date-order" name="date_order" class="datetimepicker input-sm" data-picker-locale="en-us" data-picker-format="Y-MM-DD HH:mm" size="16" value="14 12 2017 09:30" style="" type="text"> My configuration contains the following:
$g_datetime_picker_format is commented out because it causes further problems. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Datetime picker screenshot. |
|
I believe this is due to the inconsistency between the MantisBT date format ( Given the date 14.12.2017 in your screenshots as an example, the day becomes the year (14), and the year (2017) is truncated to 2 chars and becomes the day (20). I suggest you try setting $g_datetime_picker_format as appropriate to match your normal date format (at least in the order of the date's elements, d/m/y). Finally, with regards to `$g_datetime_picker_format = "D MMM Y H:mm"; causing further problems , I just tried this locally and it seems to work just fine AFAICT so I'm not sure what your problem is. |
|
Changing my configuration to:
results in the expected date and datetime picker display. Is it a requirement of Mantis that The following configuration causes Mantis to misinterpret the values in the Date Order field:
the normal format is configured with a numeric month with leading zeros, while the picker format's month is e.g. "Jan". |
|
I never thought about it until today, but I guess it should be, reason being that the date value has to be passed on from Mantis (PHP) to the date picker (Javascript) - and back - via the input field's contents so the format should be consistent. In any case, I fail to understand why you would want to use different formats to display dates. Doesn't make sense to me. |
|
I updated the Admin Guide to reflect the need for $g_normal_date_format and $g_datetime_picker_format to be consistent. |
|
Just for reference, I want to use the following two formats, the shorter one for where space is a priority, the longer one for where I want clarity first:
|
|
The places where the different date formats are used can only be changed in the source code, but you still need to maintain the consistency between $g_datetime_picker_format align and $g_normal_date_format. With regards to "where space is a priority", this is why we have short_date_format. Check the docs for more info on where each format is used, or look at the source. |
|
MantisBT: master eae6f667 2017-11-03 06:09 Details Diff |
Document need for consistency in date formats $g_datetime_picker_format and $g_normal_date_format settings need to be consistent. Differences between them may result in unexpected behavior such as an invalid interpretation of the date by the DateTime picker widget, or errors trying to save a modified date. Fixes 0023578 |
Affected Issues 0023578 |
|
mod - config_defaults_inc.php | Diff File | ||
mod - docbook/Admin_Guide/en-US/config/date.xml | Diff File |