You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2020/07/28 05:20:51 UTC

[openoffice] branch trunk updated: java.util.Calendar's MONTH is 0-based.

This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d917f5e  java.util.Calendar's MONTH is 0-based.
d917f5e is described below

commit d917f5e50e8747870854d4ad71be7f834cc09fd3
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
---
 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;