public function date_picker()
{
return _class('html')->date_picker('input_name', '2015-02-02');
}
public function date_picker($name, $cur_date = '')
{
js('jquery-ui');
css('jquery-ui');
jquery('$(".datepicker").datepicker({ dateFormat: "yy-mm-dd" });');
css('//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.4/css/jquery.ui.datepicker.min.css');
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
// TODO: use input() unified control
return '<input type="text" name="' . $name . '" class="datepicker" value="' . $cur_date . '" style="width:80px" readonly="true" id="' . $extra['id'] . '" />';
}