View Issue Details

IDProjectCategoryView StatusLast Update
0025200mantisbtadministrationpublic2019-04-17 14:47
Reportersamtuke Assigned Toatrol  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version2.18.0 
Summary0025200: On the manage project version page dates are loaded in incorrect format and datepicker mangles them
Description

On the manage project version page release dates are loaded in the wrong format, and the datepicker can also not understand them. Together this results in the wrong dates being saved and valid dates being malformed.

Steps To Reproduce

Visit the page, e.g. /manage_proj_ver_edit_page.php?version_id=150
If a release date was previously set, see that it has now been changed and malformed
If a release date was not set, try to guess the format used for text entry, and save the date
If you guessed the correct format, congrats! Try editing your valid date again
Observe it has now been malformed again
Try now using the datepicker and see the year is set to e.g. 0007 or 0019

TagsNo tags attached.
Attached Files
Selection_503.png (9,666 bytes)   
Selection_503.png (9,666 bytes)   

Relationships

related to 0025699 closedatrol Date Order on manage projects page switchs format after editing 

Activities

atrol

atrol

2019-01-10 16:52

developer   ~0061202

Did you consider the warning for $g_datetime_picker_format https://www.mantisbt.org/docs/master/en-US/Admin_Guide/html-desktop/#admin.config.date ?

samtuke

samtuke

2019-01-14 08:43

reporter   ~0061228

@atrol No, thanks for the pointer. $g_datetime_picker_format is not defined in our config_defaults_inc.php or config_local.php files.

I added it as follows after trial and error with the separte momentjs format:

$g_normal_date_format = 'd-m-y H:i';
$g_datetime_picker_format = 'DD-MM-YY HH:mm';

That appears to have fixed it.

These don't seem like 'sane defaults'. If $g_datetime_picker_format isn't set, shouldn't it take it from $g_normal_date_format by default (or convert the format if they're incompatible)?

atrol

atrol

2019-01-14 09:05

developer   ~0061229

$g_datetime_picker_format is not defined in our config_defaults_inc.php

Sure?
It's there in original config_defaults_inc.php of version 2.18.0
https://github.com/mantisbt/mantisbt/blob/release-2.18.0/config_defaults_inc.php#L1321

You never ever should change config_defaults_inc.php as you might get problems when upgrading.
All configuration should be done in config_inc.php.

atrol

atrol

2019-01-27 10:13

developer   ~0061309

samtuke,

I assume the issue was caused by your changed config_defaults_inc.php
As you did not provide feedback, I am resolving this issue as "no change required".