HTML Part for adding calendar picker in admin side

<input name="dob" id="dob" value="" type="text" style="width:110px !important;" /> <img src="<?php echo $this->getSkinUrl('images/grid-cal.gif'); ?>" alt="" id="_accountdob_trig" title="Select Date" style="" />
 <script type="text/javascript">
 //<![CDATA[
 Calendar.setup({
 inputField: "dob",
 ifFormat: "%m/%e/%y",
 showsTime: false,
 button: "_accountdob_trig",
 align: "Bl",
 singleClick : true
 });
 //]]>
 </script>

in PHP Side

$dob = Mage::app()->getLocale()->date($postData['dob'], Zend_Date::DATE_SHORT);
 $customer->setDob($dob->toString('YYYY-MM-dd'));

Here $customer is using for customer model and storing the dob.

 

© 2014 Developers Corner Suffusion theme by Sayontan Sinha