Jaison Justus
Jaison Justus

Reputation: 2793

jquery ui datepicker - firstday

in my code i used first day to set the day names starting from monday ... sunday. the code snippet is

$( ".txt_calender" ).datepicker({
            minDate: 0,
            firstDay: 1,
            dateFormat: '<?php if (isset(Yii::app()->session['jsDateFormat']))
{
    echo Yii::app()->session['jsDateFormat'];
} else
{
    echo 'm/d/Y';
} ?>'
        });

but when i click the textbox, it shows day names starts from sunday. what is the issue with the code snippet.

Upvotes: 0

Views: 1624

Answers (1)

Dominic Green
Dominic Green

Reputation: 10260

Have you tried setting it after init like

$( ".txt_calender" ).datepicker({
            minDate: 0,
            dateFormat: '<?php if (isset(Yii::app()->session['jsDateFormat']))
{
    echo Yii::app()->session['jsDateFormat'];
} else
{
    echo 'm/d/Y';
} ?>'
        });


    $( ".txt_calender" ).datepicker( "option", "firstDay", 1 );

Upvotes: 1

Related Questions