Executing this on 06th Dec 2013,
both the alerts print "31-Dec-2013" while the expected result in the second print at line:5 is "31-Dec-2008".
- dateParam = "13-Dec-2013".toDate();
- alert eomonth(dateParam,0);
- dateParam = "13-Dec-2008".toDate();
- alert eomonth(dateParam,0);
For now, I'm using the following work-around with expected results:
- dateParam = toStartOfMonth("13-Dec-2013".toDate());
- alert dateParam.addMonth(1).subDay(1);
-Varun