View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0023701 | mantisbt | localization | public | 2017-12-06 04:02 | 2024-10-09 06:15 |
| Reporter | chadmiss | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | have not tried |
| Status | new | Resolution | open | ||
| Summary | 0023701: different or localized datetime formats delete due_date on updates | ||||
| Description | the parameters $g_normal_date_format; have to have the same display format (the definition spec is different for those parameters), otherwise the original due_date is not shown when updating a bug. something like this configuration will result in an empty due_date field: also when using a date-format with localized names for the datetimepicker (for example german "10-Dez-2017", config from the second example) the sent value will not be translated to a timestamp in bug_update.php by strtotime() | ||||
| Tags | No tags attached. | ||||
| Attached Files | |||||
|
On 2.15.0, my config : Consistency is compliant with warning provided in https://www.mantisbt.org/docs/master/en-US/Admin_Guide/html-desktop/#admin.config.date. During version update, I can see that the saved date is wrong : define 06/08/2018 on screen, 08/06/2018 is saved. Month and day are switched. My workaround to transform custom date format to default date format awaited by , in workaround.diff (1,200 bytes)
diff --git a/manage_proj_ver_update.php b/manage_proj_ver_update.php
index 538fc6697..294ada949 100644
--- a/manage_proj_ver_update.php
+++ b/manage_proj_ver_update.php
@@ -65,6 +65,7 @@ $f_description = gpc_get_string( 'description' );
$f_released = gpc_get_bool( 'released' );
$f_obsolete = gpc_get_bool( 'obsolete' );
+
access_ensure_project_level( config_get( 'manage_project_threshold' ), $t_version->project_id );
if( is_blank( $f_new_version ) ) {
@@ -77,7 +78,8 @@ $t_version->version = $f_new_version;
$t_version->description = $f_description;
$t_version->released = $f_released ? VERSION_RELEASED : VERSION_FUTURE;
$t_version->obsolete = $f_obsolete;
-$t_version->date_order = $f_date_order;
+$defined_date = DateTime::createFromFormat( config_get( 'normal_date_format' ),$f_date_order ); # consistency between normal and datepicker is mandatory because we use normal_date_format to understand a date defined in GUI through datetime_picker_format
+$t_version->date_order = $defined_date->format( 'Y-m-d H:i:s' ); # default normal_date_format in config_default_inc.php
version_update( $t_version );
event_signal( 'EVENT_MANAGE_VERSION_UPDATE', array( $t_version->id ) );
|
|