This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Remove "Day" from Date format
Started 14 years ago by jlking98 | 4 posts |
-
Is it possible to remove the "Day" section from the date format and if so how can I do it?
Posted 14 years ago # -
Yes, it's possible. To do this, you need to modify "includes/view-function.php" file. Edit the file and go to around line 363 ~ 374, you'll see these code :
<span> <input id="element_{$element->id}_1" name="element_{$element->id}_1" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_1']['default_value']}" type="text" /> / <label for="element_{$element->id}_1">{$lang['date_mm']}</label> </span> <span> <input id="element_{$element->id}_2" name="element_{$element->id}_2" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_2']['default_value']}" type="text" /> / <label for="element_{$element->id}_2">{$lang['date_dd']}</label> </span> <span> <input id="element_{$element->id}_3" name="element_{$element->id}_3" class="element text" size="4" maxlength="4" value="{$element->populated_value['element_'.$element->id.'_3']['default_value']}" type="text" /> <label for="element_{$element->id}_3">{$lang['date_yyyy']}</label> </span>
then replace the code with these
<span> <input id="element_{$element->id}_1" name="element_{$element->id}_1" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_1']['default_value']}" type="text" /> / <label for="element_{$element->id}_1">{$lang['date_mm']}</label> </span> <span style="display:none"> <input id="element_{$element->id}_2" name="element_{$element->id}_2" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_2']['default_value']}" type="text" /> / <label for="element_{$element->id}_2">{$lang['date_dd']}</label> </span> <span> <input id="element_{$element->id}_3" name="element_{$element->id}_3" class="element text" size="4" maxlength="4" value="{$element->populated_value['element_'.$element->id.'_3']['default_value']}" type="text" /> <label for="element_{$element->id}_3">{$lang['date_yyyy']}</label> </span>
if you're using dd/mm/yyyy format, you need to edit the code around line 428~439
<span> <input id="element_{$element->id}_1" name="element_{$element->id}_1" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_1']['default_value']}" type="text" /> / <label for="element_{$element->id}_1">{$lang['date_dd']}</label> </span> <span> <input id="element_{$element->id}_2" name="element_{$element->id}_2" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_2']['default_value']}" type="text" /> / <label for="element_{$element->id}_2">{$lang['date_mm']}</label> </span> <span> <input id="element_{$element->id}_3" name="element_{$element->id}_3" class="element text" size="4" maxlength="4" value="{$element->populated_value['element_'.$element->id.'_3']['default_value']}" type="text" /> <label for="element_{$element->id}_3">{$lang['date_yyyy']}</label> </span>
and change it to
<span style="display:none"> <input id="element_{$element->id}_1" name="element_{$element->id}_1" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_1']['default_value']}" type="text" /> / <label for="element_{$element->id}_1">{$lang['date_dd']}</label> </span> <span> <input id="element_{$element->id}_2" name="element_{$element->id}_2" class="element text" size="2" maxlength="2" value="{$element->populated_value['element_'.$element->id.'_2']['default_value']}" type="text" /> / <label for="element_{$element->id}_2">{$lang['date_mm']}</label> </span> <span> <input id="element_{$element->id}_3" name="element_{$element->id}_3" class="element text" size="4" maxlength="4" value="{$element->populated_value['element_'.$element->id.'_3']['default_value']}" type="text" /> <label for="element_{$element->id}_3">{$lang['date_yyyy']}</label> </span>
MachForm Support
Posted 14 years ago # -
Could you update this (maybe move it to the 3.0 forum as well) with the 3.0 code? Is there anyway to keep the existing date formats and just ADD the MM/YYYY format to the drop down date format list?
I think this is a simillar request as the "remove DD from date field" post.
Posted 12 years ago # -
Yes this is similar to my post at: http://www.appnitro.com/forums/topic/remove-dd-from-date-field?replies=3
The only difference is that I am looking to remove the DD field from only a specific form, not all forms.
Posted 12 years ago #
Reply
You must log in to post.