View Issue Details

IDProjectCategoryView StatusLast Update
0022558mantisbtbugtrackerpublic2019-09-25 10:40
Reporterrct Assigned Tosyncguru  
Status assignedResolutionopen 
Product Version2.2.1 
Summary0022558: Problem with datepicker and custom date format


I've noticed a problem when you use custom date format (french here) in the project version datepicker and the due date datepicker.
One fails with ERROR_INVALID_DATE_FORMAT and the other ignore the due date.
It seems to be ok when I let the default english date format.

For the project version it fails in the class VersionData method __set on function strtotime (Parse about any English textual datetime description into a Unix timestamp. / the date is not in english format).
For the due date the problem also comes from the strtotime function in the bug_update.php.

I dig a little more and I think there is a problem with the date format design: if it is defined at the global level you cannot define a date format matching for example a country because if some users come from another country they will have an unknown date format for them (and if they use another language there are problems with some code using the user language to decode string date format to timestamp).

Why not defining those date format in the language files?

Steps To Reproduce

$g_normal_date_format='d/m/Y H:i';
$g_complete_date_format='d/m/Y H:i';
$g_datetime_picker_format='DD/MM/YYYY HH:mm';

TagsNo tags attached.




2017-03-21 22:01

manager   ~0056156

I wonder if this is fixed by 0008957.



2017-05-04 07:25

reporter   ~0056772

Any update on this?



2018-10-30 14:23

reporter   ~0060880

Last edited: 2018-10-31 12:08

View 2 revisions

I Confirm that bug in Mantis MantisBT 2.15.0

When you change date variable $g_normal_date_format in config/config_inc.php

   # --- date format settings --------
   # date format strings defaults to ISO 8601 formatting
   # go to
   # for detailed instructions on date formatting
   $g_normal_date_format   = 'd/m/y H:i';

a bug occurs in the project version datepicker
To resolve that, we modified the file manage_proj_ver_edit_page.php
line 103 :
remplace string_attribute( date( config_get( 'normal_date_format' ), $t_version->date_order ) )
by string_attribute( date( "Y/m/d H:i", $t_version->date_order ) )

01-version-date-picker.png (105,176 bytes)   
01-version-date-picker.png (105,176 bytes)   


2019-09-25 10:00

reporter   ~0062906

Last edited: 2019-09-25 10:01

View 3 revisions

I can confirm that the bug is still in V2.22.0
JPKs solution works just perfect.
Only "real" quote-characters need to be used instead if the quot-html-stuff



2019-09-25 10:40

reporter   ~0062907

Attached you see the same server contacted from 2 different clients.
Date on right client totally spoiled.
Again, JPK's solution resolves that here.

a.png (31,105 bytes)   
a.png (31,105 bytes)   

Issue History

Date Modified Username Field Change
2017-03-21 10:14 rct New Issue
2017-03-21 21:59 vboctor Assigned To => syncguru
2017-03-21 21:59 vboctor Status new => assigned
2017-03-21 22:01 vboctor Note Added: 0056156
2017-05-04 07:25 rct Note Added: 0056772
2018-10-30 14:23 JPK File Added: 01-version-date-picker.png
2018-10-30 14:23 JPK File Added: 02-version-project-date-picker-code.png
2018-10-30 14:23 JPK Note Added: 0060880
2018-10-31 12:08 dregad Note Edited: 0060880 View Revisions
2019-09-25 10:00 ralfiii Note Added: 0062906
2019-09-25 10:00 ralfiii Note Edited: 0062906 View Revisions
2019-09-25 10:01 ralfiii Note Edited: 0062906 View Revisions
2019-09-25 10:40 ralfiii Note Added: 0062907
2019-09-25 10:40 ralfiii File Added: a.png