View Issue Details

IDProjectCategoryView StatusLast Update
0026906mantisbtbugtrackerpublic2020-05-18 16:04
Reportersandyj Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Summary0026906: Due_date_default setting is not populating when specific normal_date_format configured
Description

When configuring a due date default value, the default due date value is not appearing when creating new tickets.

Testing shows that this only occurs when the normal_date_format has been configured to include "D" or "M" denoting textual representation of day or month.

Steps To Reproduce

Configure due_date_default to any value (e.g. 'today', '+4 days')
configure normal_date_format to include 'D' or 'M' (e.g. d-M-Y H:i)
report an issue - you will see due date default is not populated i.e. due date is blank
then
configure normal_date_format removing 'D' and/or 'M' (e.g. d-m-Y H:i)
report an issue - this field is now populated.

TagsNo tags attached.

Relationships

duplicate of 0022558 closeddregad Problem with datepicker and custom date format 

Activities

dregad

dregad

2020-04-22 09:51

developer   ~0063890

I can reproduce this on my dev box.

dregad

dregad

2020-04-22 10:24

developer   ~0063891

@sandyj Did you set $g_datetime_picker_format as appropriate to match the $g_normal_date_format config ?

https://github.com/mantisbt/mantisbt/blob/master/config_defaults_inc.php#L1323

sandyj

sandyj

2020-04-22 21:59

reporter   ~0063896

Last edited: 2020-04-22 21:59

@dregad no, but tested it just now. If I set:

  1. date_picker_format to be same as normal_date_format without an "M" then this breaks and due date default does NOT populate
  2. date_picker_format to be the same at normal_date_format including an "M" then due date default does NOT populate
  3. date_picker_format to contain "M" and normal_date_format without an "M" then due date default does NOT populate (this worked previous to adding date_picker config)
  4. date_picker_format without an "M" and normal_date_format including an "M" then due date default does NOT populate.

So looks like date_picker config does not fix the issue and breaks the working condition. Date setting I was using to test is d-M-Y H:i or d-m-Y H:i

dregad

dregad

2020-04-23 05:00

developer   ~0063899

Last edited: 2020-04-23 05:00

Not sure you're aware that $g_datetime_picker_format uses moment.js format, not the PHP standard used for our other date formats.

In your case, PHP M (3 letter month) should be MMM, so the following config works for me:

$g_normal_date_format = 'd-M-Y H:i';
$g_datetime_picker_format = 'D-MMM-Y HH:mm';

Closing as duplicate of 0022558.