View Issue Details

IDProjectCategoryView StatusLast Update
0022558mantisbtbugtrackerpublic2018-10-31 12:08
Reporterrct Assigned Tosyncguru  
PrioritynormalSeveritymajorReproducibilityalways
Status assignedResolutionopen 
Product Version2.2.1 
Target VersionFixed in Version 
Summary0022558: Problem with datepicker and custom date format
Description

Hi,

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. http://www.php.net/manual/en/function.strtotime.php / 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_short_date_format='d/m/Y';
$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.

Activities

vboctor

vboctor

2017-03-21 22:01

manager   ~0056156

I wonder if this is fixed by 0008957.

rct

rct

2017-05-04 07:25

reporter   ~0056772

Hello,
Any update on this?
Romain

JPK

JPK

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 http://www.php.net/manual/en/function.date.php
   # 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)

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