Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

In my project am using ajax datepicker ,and am using calender icon ,when i click this image calender opens , if i select the date it appears in the textbox.

In this today date is highlighted (march-8),but i need to display my server date.
if my server date is (march-9) mean i need to display the same .shall i change my jquery,How can i do? help me!
Posted
Updated 8-Mar-12 23:40pm
v5

DataPicker has an option to set the defaultDate as:


C#
//getter
var defaultDate = $( ".selector" ).datepicker( "option", "defaultDate" );
//setter
$( ".selector" ).datepicker( "option", "defaultDate", +7 );


Specify the server date via a Date object or as a string in the current dateFormat, or a number of days.
 
Share this answer
 
Comments
priya from Madras 8-Mar-12 3:06am    
defaultDate = (defaultDate ? $.datepick.newDate(defaultDate) : null);


shall i change in this ?
priya from Madras 8-Mar-12 6:23am    
Hi ganesh,

shall i change in my js file
Hi all ,


my calender is displaying today date(today is march 9 2012). i want to get server date in my ajaxdatepicker calender, if my server date is mar 10 2012 mean i need to get mar 10 2012 in my calender.actually i have tried like below


to get server date time i used this('<%= DateTime.Now.ToString() %>').but nothing happened

how can i do ?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900