summaryrefslogtreecommitdiff
path: root/external/jfreereport/patches/libformula-datevalue_truncation.patch.1
diff options
context:
space:
mode:
Diffstat (limited to 'external/jfreereport/patches/libformula-datevalue_truncation.patch.1')
-rw-r--r--external/jfreereport/patches/libformula-datevalue_truncation.patch.129
1 files changed, 29 insertions, 0 deletions
diff --git a/external/jfreereport/patches/libformula-datevalue_truncation.patch.1 b/external/jfreereport/patches/libformula-datevalue_truncation.patch.1
new file mode 100644
index 000000000000..069c667c19ac
--- /dev/null
+++ b/external/jfreereport/patches/libformula-datevalue_truncation.patch.1
@@ -0,0 +1,29 @@
+diff -ur jfreereport_libformula.org/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java
+--- jfreereport_libformula.org/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java 2010-06-01 17:15:50.000000000 +0200
++++ jfreereport_libformula/source/org/pentaho/reporting/libraries/formula/function/datetime/DateValueFunction.java 2015-07-14 17:24:42.503895240 +0200
+@@ -18,6 +18,7 @@
+ package org.pentaho.reporting.libraries.formula.function.datetime;
+
+ import java.util.Date;
++import java.util.Calendar;
+
+ import org.pentaho.reporting.libraries.formula.EvaluationException;
+ import org.pentaho.reporting.libraries.formula.FormulaContext;
+@@ -28,6 +29,7 @@
+ import org.pentaho.reporting.libraries.formula.typing.Type;
+ import org.pentaho.reporting.libraries.formula.typing.TypeRegistry;
+ import org.pentaho.reporting.libraries.formula.typing.coretypes.DateTimeType;
++import org.pentaho.reporting.libraries.formula.util.DateUtil;
+
+ /**
+ * This function returns
+@@ -61,7 +63,8 @@
+ final Object value = parameters.getValue(0);
+
+ final Date date1 = typeRegistry.convertToDate(type, value);
+- return new TypeValuePair(DateTimeType.DATE_TYPE, date1);
++ final Date date = DateUtil.normalizeDate(date1, DateTimeType.DATE_TYPE);
+
++ return new TypeValuePair(DateTimeType.DATE_TYPE, date);
+ }
+ }