changeset 1077:7143cd96d3de

Calendar.DAY_OF_YEAR is 1-based.
author Tom Gottfried <tom@intevation.de>
date Fri, 30 Sep 2016 18:41:12 +0200
parents 4ce4bd48c260
children 7974d3cc974f
files db_schema/lada_schema.sql src/main/java/de/intevation/lada/factory/ProbeFactory.java src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java
diffstat 3 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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,
--- 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() {
--- 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) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)