Reputation: 13
I have one devexpress dateedit control.i am trying to provide navigation to it.i kept two buttons "next" and "prev" when user click next button i want to change the current date to next date for example if current date is 02/feb next date is 03/feb like that.similarly for previous button.
how i can achieve this using java script.
Thanks in advance.
Arasu
Upvotes: 0
Views: 3998
Reputation: 1886
Give your control a clientinstancename (myDateEdit or something), and refer to the control in that manner. Then in the function called by the next button get the date from the control and set it to a Date. Then set the date plus one day back to the control.
var curDate = myDateEdit.GetDate();
var newDate = new Date(curDate);
newDate.setDate(curDate.getDate() + 1);
myDateEdit.SetDate(newDate);
Upvotes: 1