CakePHP

CakePHP Date Picker

datepickerhtml5
 
When baking a project with CakePHP, the default view for date is shown as single select for month, day and year. Developer can change this view into a datepicker which is more attractive and easy to use. Read this post for more information on how to change the CakePHP date picker.

 

date2

To change the date view, open the view file that consist date input and add the array for date picker as shown below:

echo $this->Form->input('dob', array(
				'label'=>'Date of Birth',
				'type'=>'date',
				'dateFormat'=>'M D Y',
				'empty'=>false,
				'minYear'=>'1920',
				'maxYear'=>date('Y')
					)
				);

 

 

Good luck!
Author Information
Muhammad Asyraf bin Wahi Anuar
Web Administrator
Asyraf enjoys life and has great enthusiasm for all outdoors activities especially MTB! Don't Follow Me. I'm Lost Too -_-

Tags: ,
Muhammad Asyraf bin Wahi Anuar | Copyright 2017 | Informatic Trooper