"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Thursday, April 12, 2012

Next and Prev date using Jquery DateTime picker

Hi all,
Showing Next and Previous date of current date using Jquery.Biggest problem that you may find doing this will be date-time format.
                       var nextDayDate = $("#<%=txtDate.ClientID%>").datepicker('getDate', '+1d');
                        debugger;
                        nextDayDate.setDate(
nextDayDate.getDate() + 1);
                        //alert(nextDayDate);
                        nextDayDate=nextDayDate.
localeFormat('MM/dd/yyyy');
                        $("#<%=lblNxt.ClientID%>").
text(nextDayDate);
                        var PreVDayDate = $("#<%=txtDate.ClientID%>").
datepicker('getDate', '+1d');
                        PreVDayDate.setDate(
PreVDayDate.getDate() -1);
                        PreVDayDate =PreVDayDate.localeFormat('MM/
dd/yyyy');
                        $("#<%=lblPrev.ClientID%>").
text(PreVDayDate);

If u had any trouble just ask, 
Happy to help u :) Stay Tune...
 Have a nice day... 'N happy Coding 
:)