Datepicker (calendar)

Add Datepicker, option type C

For Datepicker to be loaded The option type C is required or 

$options['datepicker'] = true

To use Datepicer in your forms use the following script:

 

addField([
   'type'=>'datepicker', //required
   'attributes'=>'required', //optional
   'name'=>'due_date', //optional (leave empty if you don't want to submit the value)
   'value'=> $db_items->result(0,'DOB'),  //optional (predefined value)
   'label'=>'Date of Birth', //required
   'id'=>'', //optional (name becomes the id by default)
   'style'=>'', //optional
   'class'=>'', //optional
   'blockClass'=>'', //optional (class for the container)
   'blockStyle'=>'', //optional (style for the container)
   'dataString'=>'data-test="value"', //optional (full data attribute and value)
]);