- var adjustDate = function(date, offset, last) {
- var wasLastDay = (date.getDate() == last);
- var lastDay = $.countdown._getDaysInMonth(date.getFullYear() + offset * periods[Y],
- date.getMonth() + offset * periods[O]);
- if (date.getDate() > lastDay) {
- date.setDate(lastDay);
- }
- date.setFullYear(date.getFullYear() + offset * periods[Y]);
- date.setMonth(date.getMonth() + offset * periods[O]);
- if (wasLastDay) {
- date.setDate(lastDay);
- }
- return date;
- };
- if (inst._since) {
- until = adjustDate(until, -1, lastUntil);
+ now = new Date(now.getTime());
+ var wasLastDay = (now.getDate() == lastNow);
+ var lastDay = $.countdown._getDaysInMonth(now.getFullYear() + periods[Y],
+ now.getMonth() + periods[O]);
+ if (now.getDate() > lastDay) {
+ now.setDate(lastDay);