Documentation

CalendarPeriod

string
CalendarPeriod(
 string field_from_name,
 string field_from_value,
 string field_to_name,
 string field_to_value,
 string form = "skform",
 string select_enabled = "N",
 string select_param = "class=\"typeselect\"",
 string fields_param = "class=\"typeinput\"",
 string fields_size = "10"
);
CalendarPeriod returns the HTML code of two input fields with icons. Icons display a standard calendar window if clicked. The first field also has a drop-down list with values from 1 to 90. If a user selects a value in the list, the first input field is set to the current date less

The function returns HTML code for two input fields of "from" and "to" dates with icons. Icons display a standard calendar window if clicked. The first field also has a drop-down list with values from 1 to 90. If a user selects a value in the list, the first input field is set to the current date minus the number of selected days. Written in JavaScript.

Function parameters

ParameterDescription
field_from_name Input field name for the first date in range ("from"):
<input type="text" name="field_from_name" ... >
field_from_value Initial value for the first date in range ("from"):
<input type="text" value="field_from_value" ... >
field_to_name Input field name for the second date in range ("to"):
<input type="text" name="field_to_name" ... >
field_to_value Initial value for the second date in range ("from")):
<input type="text" value="field_to_value" ... >
form Name of the form containing the input fields for dates:
<form name="form">
Optional parameter, "skform" value by default.
select_enabled If "Y", displays a list of days from 1 to 90, for quicker selection of the date.
Optional parameter; the default value is "N" (hides the list).
select_param String with additional attributes of days list:
<select name="field_from_name_DAYS_TO_BACK" select_param ... >
Optional parameter; the default value: class="typeselect".
fields_param String with additional attributes of input fields for dates:
<input type="text" fields_param ... >
Optional parameter; the default value is class="typeinput".
fields_size Input field width:
<input type="text" size="fields_size" ... >
Optional parameter; the default value is "10". If the value is higher then 10, the time of day selection is added to the period date.

See Also

Examples of use

<form action="<?=$APPLICATION->GetCurPage()?>" method="POST" name="form1">
<?echo CalendarPeriod("date_from", "25.10.2003", "date_to", "29.10.2003", "form1", "Y")?>
</form>


© «Bitrix24», 2001-2022
Up