Skip to content

bug fix for month increment - February is going amiss in some cases.#22

Open
yashwanthm wants to merge 1 commit intoivanchenko:masterfrom
yashwanthm:master
Open

bug fix for month increment - February is going amiss in some cases.#22
yashwanthm wants to merge 1 commit intoivanchenko:masterfrom
yashwanthm:master

Conversation

@yashwanthm
Copy link

The month increment decrement operator is buggy and this should help increment the month correctly.
February as a month doesn't get constructed in some cases when done this way:

if (isFutureDate) {
 monthIterator.setMonth(monthIterator.getMonth() + 1);
} else {
 monthIterator.setMonth(monthIterator.getMonth() - 1);
}

This should take care of it correctly.

if (isFutureDate) {
 monthIterator.setMonth(monthIterator.getMonth() + 1, 1);
} else {
 monthIterator.setMonth(monthIterator.getMonth() - 1, 1);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant