You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2020/07/28 19:13:28 UTC
[openoffice] 02/03: java.util.Calendar's MONTH is 0-based.
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 25e09e76c1fa80a58bc663d44347c3329a042a1b
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Tue Jul 28 07:20:12 2020 +0200
java.util.Calendar's MONTH is 0-based.
Patch by: me
(cherry picked from commit d917f5e50e8747870854d4ad71be7f834cc09fd3)
---
test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java b/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java
index cece47a..4c7ce94 100644
--- a/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java
+++ b/test/testuno/source/fvt/uno/sd/file/CheckFileProperties.java
@@ -183,7 +183,8 @@ public class CheckFileProperties {
Calendar ca = Calendar.getInstance();
DateTime currentDateTime = new DateTime();
currentDateTime.Year = (short)ca.get(Calendar.YEAR);
- currentDateTime.Month = (short)ca.get(Calendar.MONTH);
+ // java.util.Calendar's months start at 0=January.
+ currentDateTime.Month = (short)(ca.get(Calendar.MONTH) + 1);
currentDateTime.Day = (short)ca.get(Calendar.DATE);
currentDateTime.Minutes = (short)ca.get(Calendar.MINUTE);
currentDateTime.Hours = (short)ca.get(Calendar.HOUR);
@@ -196,7 +197,8 @@ public class CheckFileProperties {
Calendar ca = Calendar.getInstance();
Date currentDate = new Date();
currentDate.Year = (short)ca.get(Calendar.YEAR);
- currentDate.Month = (short)ca.get(Calendar.MONTH);
+ // java.util.Calendar's months start at 0=January.
+ currentDate.Month = (short)(ca.get(Calendar.MONTH) + 1);
currentDate.Day = (short)ca.get(Calendar.DATE);
return currentDate;