Fix content end date if already in new year (#15376)

* Fix content end date if already in new year

* fix test
This commit is contained in:
Phillip Thelen
2025-01-02 18:15:04 +01:00
committed by GitHub
parent aa432022d3
commit 62e6fbef61
3 changed files with 10 additions and 2 deletions

View File

@@ -895,7 +895,9 @@ function makeEndDate (checkedDate, matcher) {
end.minute(0);
end.second(0);
if (matcher.endMonth !== undefined) {
if (matcher.startMonth && matcher.startMonth > matcher.endMonth) {
if (matcher.startMonth
&& matcher.startMonth > matcher.endMonth
&& checkedDate.getMonth() > matcher.endMonth) {
end.year(checkedDate.getFullYear() + 1);
}
end.month(matcher.endMonth);