Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use jquery-datepicker for date range

Can someone tell me how to use the jquery-datepicker for a date range in yii? I got it to work for a single date how do i modify it to get a multiple dates. I am new to yii framework.

like image 988
Necia Avatar asked Jul 09 '11 00:07

Necia


People also ask

How do you use a date range picker?

A JavaScript component for choosing date ranges, dates and times. Originally created for reports at Improvely, the Date Range Picker can be attached to any webpage element to pop up two calendars for selecting dates, times, or predefined ranges like "Last 30 Days".

How can I set start and end dates for a Datepicker?

Setting a start and end datevar start_date = new Date(). increment('week', 1); var end_date = new Date(). increment('week', 5); This will allow the picking of dates between one week and five weeks in the future.

How do I change date format in Datepicker?

An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field.


1 Answers

Try This For Example:

<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(
    'model'=>$model, 'attribute'=>'birthday',
    'options'=>array(
        'dateFormat'=>'yy-mm-dd',
        'yearRange'=>'-70:+0',
        'changeYear'=>'true',
        'changeMonth'=>'true',
    ),
)); ?>
like image 172
jamband Avatar answered Oct 17 '22 04:10

jamband