[Lada-commits] [PATCH 5 of 5] Calendar.DAY_OF_YEAR is 1-based

Wald Commits scm-commit at wald.intevation.org
Fri Sep 30 18:42:34 CEST 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1475253672 -7200
# Node ID 7143cd96d3de9c061143f15ea519c6b49f25eced
# Parent  4ce4bd48c26058c82bae7a9ae4aa16043df502e1
Calendar.DAY_OF_YEAR is 1-based.

diff -r 4ce4bd48c260 -r 7143cd96d3de db_schema/lada_schema.sql
--- a/db_schema/lada_schema.sql	Fri Sep 30 18:32:48 2016 +0200
+++ b/db_schema/lada_schema.sql	Fri Sep 30 18:41:12 2016 +0200
@@ -583,8 +583,8 @@
     teilintervall_von integer NOT NULL,
     teilintervall_bis integer NOT NULL,
     intervall_offset integer NOT NULL DEFAULT 0,
-    gueltig_von integer NOT NULL CHECK(gueltig_von BETWEEN 0 AND 364),
-    gueltig_bis integer NOT NULL CHECK(gueltig_bis BETWEEN 0 AND 364),
+    gueltig_von integer NOT NULL CHECK(gueltig_von BETWEEN 1 AND 365),
+    gueltig_bis integer NOT NULL CHECK(gueltig_bis BETWEEN 1 AND 365),
     probe_nehmer_id integer,
     probe_kommentar character varying(80),
     letzte_aenderung timestamp without time zone DEFAULT now() NOT NULL,
diff -r 4ce4bd48c260 -r 7143cd96d3de src/main/java/de/intevation/lada/factory/ProbeFactory.java
--- a/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Fri Sep 30 18:32:48 2016 +0200
+++ b/src/main/java/de/intevation/lada/factory/ProbeFactory.java	Fri Sep 30 18:41:12 2016 +0200
@@ -168,7 +168,7 @@
         }
 
         public boolean startInLeapYear() {
-            return from.getActualMaximum(Calendar.DAY_OF_YEAR) > 364;
+            return from.getActualMaximum(Calendar.DAY_OF_YEAR) > 365;
         }
 
         public int getStartDOY() {
diff -r 4ce4bd48c260 -r 7143cd96d3de src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java
--- a/src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java	Fri Sep 30 18:32:48 2016 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java	Fri Sep 30 18:41:12 2016 +0200
@@ -19,10 +19,10 @@
 @ValidationRule("Messprogramm")
 public class ValidFromTo implements Rule {
 
-    private static final int DOY_MIN = 0;
+    private static final int DOY_MIN = 1;
 
     // Leap years should be handled in generation of Probe objects
-    private static final int DOY_MAX = 364;
+    private static final int DOY_MAX = 365;
 
     @Override
     public Violation execute(Object object) {


More information about the Lada-commits mailing list