uneuronh
unread,Apr 26, 2011, 2:42:12 PM4/26/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Datejs - A JavaScript Date Library
Hi,
I have customers entering a date say 01/04/2011 ( dd/mm/yyyy)
I have to find the 1 year date from the entered date -1 day
i.e,
if date is 01/04/2011(dd/mm/yyy)
output should be 31/03/2012(dd/mm/yyyy)
I tried
ed = new Date.parseExact(dateText, "dd/mm/yyyy");
ed.next().year();
alert(ed.toString("dd/mm/yyyy"));
This adds one year to the entered date ie, 01/04/2012
if i do ed.add(-1).day(); the output is 31/04/2012 instead of
31/03/2012(dd/mm/yyyy)
Can anyone let me know, if there is work around
Thanks,
Umesh