Saturday, June 30, 2012

how to add 30 days to a date in javascript

function today(x){
var d1=new Date((new Date()).getTime() + y*24*60*60*1000) ;
var rr = d1.toString('yyyy-MM-dd');
a=rr.split(' ');
//return d ;

<input type="button" onclick="return today(0);" value="Today date"  />

<input type="button" onclick="return today(25);" value="NEXT 25 Days Date"  />

date picker in jquery  

$( ".txtdate" ).datepicker({
changeMonth: true,
changeYear: true
$( ".txtdate" ).datepicker( "option", "dateFormat", "dd-M-yy");
        $( ".txtdate" ).val(today('0'));

1. download necessary file from jquery 
2. call txtdate class in input box

No comments:

Post a Comment

If you Satisfied , Please Leave a comment