0

Is it possible to change the selected date(today's date) in calendar?

Example In this demo, when I click on the ... (three dots) a calendar appears and the selected date is today's date. When I select another date like 6, the 2nd time I click on the text box, the calendar appears but there are yellow shades on two dates: today's and the one I selected (6th). This is what i want to change: when one date is selected, the next time only that date should be shaded only. I hope you understand what I want to say.

Thanks in advance.

here is my script

  <script type="text/javascript">

$(function() {
   $("#fullDate").datepicker({

        showOn: "button",
        buttonImage: "images/calender.jpg",
        buttonImageOnly: true, 


        onClose: function(dateText, inst) {
        $('#year').val(dateText.split('/')[2]);
        $('#month').val(dateText.split('/')[0]);
        $('#day').val(dateText.split('/')[1]);
    }
    });
 });


</script>
dda
  • 6,030
  • 2
  • 25
  • 34
Kashif Waheed
  • 597
  • 4
  • 9
  • 18

2 Answers2

0

you can use defaultDate. Here is an example:

$('.datepicker').datePicker({ defaultDate: $.datepicker.parseDate("d m y", "31 8 2009") });
Tobias Bambullis
  • 736
  • 5
  • 17
  • 45
0

try like this example

//Set DatePicker to October 3, 2008
$('#datepicker').datepicker("setDate", new Date(2008,9,03) );

use defaultDate instead of setDate, if setDate does not work

Link reference similar question

Community
  • 1
  • 1
shareef
  • 9,255
  • 13
  • 58
  • 89