diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestWeekNumFunc.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestWeekNumFunc.java index 9ccd18dc9d..4e801a657c 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestWeekNumFunc.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestWeekNumFunc.java @@ -24,6 +24,7 @@ import org.apache.poi.util.StringUtil; import org.junit.jupiter.api.Test; import java.time.LocalDate; +import java.time.LocalDateTime; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; @@ -51,6 +52,19 @@ class TestWeekNumFunc { assertEvaluateEquals(10.0, date, 21); } + @Test + void testBug65606() { + double date = DateUtil.getExcelDate(LocalDate.parse("2021-09-27")); + assertEvaluateEquals(40.0, date); + assertEvaluateEquals(39.0, date, 21); + } + + @Test + void testDateTime() { + double date = DateUtil.getExcelDate(LocalDateTime.parse("2021-09-27T09:45:00")); + assertEvaluateEquals(40.0, date); + } + @Test void testEvaluateInvalid() { assertEvaluateEquals("no args", ErrorEval.VALUE_INVALID);