Php 螳螂自定义字段“日期”提供奇数默认值

Php 螳螂自定义字段“日期”提供奇数默认值,php,date,mantis,Php,Date,Mantis,为了收集客户发行新产品时的生产日期,我在Mantis install cur中添加了一个自定义字段,该字段的类型为Date。我没有指定默认值或可能的值 Mantis自己创建以下HTML: <tr class="row-2"> <td class="category"><span class="required">*</span>Date of Manufacture</td> <td> <

为了收集客户发行新产品时的生产日期,我在Mantis install cur中添加了一个自定义字段,该字段的类型为Date。我没有指定默认值或可能的值

Mantis自己创建以下HTML:

<tr class="row-2">
    <td class="category"><span class="required">*</span>Date of Manufacture</td>
    <td>
        <select tabindex="6" name="custom_field_3_year">
            <option value="0"></option>
            <option value="2011">2011</option>
            ...snip...
            <option value="2019">2019</option>
        </select>
        <select tabindex="7" name="custom_field_3_month">
            <option value="0"></option>
            <option value="1">January</option>
            ...snip...
            <option value="12">December</option>
        </select>
        <select tabindex="8" name="custom_field_3_day">
            <option value="0"></option>
            <option value="1">1</option>
            ...snip...
            <option value="31">31</option>
        </select>
    </td>
</tr>
月份和日期都是可以的,我们并不特别关心用户是否输入了不可能的日期,比如2月30日

然而,这些年都是一团糟。无论出于何种原因,它从2011年开始,一直持续到2019年。因为它是一个选择框,所以不能手动输入日期

什么决定了年份范围?
如何将其设置为适当的值?

我在MantisBT帮助论坛上找到了问题的答案

将这些行添加到config_inc.php文件中,并根据需要进行调整

   /**
    * Number of years in the past that custom date fields will display in
    * drop down boxes.
    * @global int $g_backward_year_count
    */
   $g_backward_year_count             = 4;

   /**
    * Number of years in the future that custom date fields will display in
    * drop down boxes.
    * @global int $g_forward_year_count
    */
   $g_forward_year_count             = 4;