31,003
edits
| Line 183: | Line 183: | ||
* class="'''button'''" on HTML fields with type ''input type="submit"''. | * class="'''button'''" on HTML fields with type ''input type="submit"''. | ||
== | == Use the Dolibarr date selector == | ||
If you want to use the Dolibarr date selector (with its calendar popup) into your pages, use the following line: | |||
$form=new Form($db); | $form=new Form($db); | ||
$form->select_date('','mykey',0,0,0,"myform"); | $form->select_date('','mykey',0,0,0,"myform"); | ||
The string mykey will identify the date selector in the form. You must use different values if you use several date selectors in same page. | |||
The string myform is the name of the FORM in which the selector is included (value found in the form name="myform" in HTML page). | |||
This means a date selector must be included necessarily into an html FORM. | |||
To get value after the POST of your form, the command is: | |||
<pre> | <pre> | ||
$ | $mydate = dol_mktime(12, 0 , 0, $_POST['mykeymonth'], $_POST['mykeyday'], $_POST['mykeyyear']); | ||
print strftime('%A %d %B %Y', $ | print strftime('%A %d %B %Y', $mydate); | ||
</pre> | </pre> | ||