I am using jquery tools date input. In my application i have a feature that allows the user to check his personal data based on date range.
I have an input text field which loads the date Input functionality. When the user select a date it displays it in : “dddd dd, mmmm yyyy” format in the text field.
What i am trying to do is to add 7 days (ie a week) and display the new date in the upper range container, to explain more this is how it looks:
From: Friday 18, May 2012
To: //here is where i want it to be : Friday 25, May 2012
I am trying to use the built in api function :addDay(amount) but it seems not to work.
I have the following code:
var ret_date = $(this).data("dateinput").getValue('dddd dd, mmmm yyyy');
//I tried: $(this).data("dateinput").addDay(7).getValue('dddd dd, mmmm yyyy')
//but it kept the same currently selected date
$("#to_field").html(ret_date);
I searched online and SO but couldn’t find a solution. I am not generally a front end developer so my knowledge with javascript/jquery is not advanced.
Any help is much appreciated
By the way, this is what i ended up doing and it worked:
The prototypes: