diff app/model/Messprogramm.js @ 781:4c1101f0ba99

Serialize Date to DayOfYear when writing/saving
author Dustin Demuth <dustin@intevation.de>
date Tue, 12 May 2015 17:41:38 +0200
parents afc9076db490
children d4eb8fb99b5e
line wrap: on
line diff
--- a/app/model/Messprogramm.js	Tue May 12 17:30:59 2015 +0200
+++ b/app/model/Messprogramm.js	Tue May 12 17:41:38 2015 +0200
@@ -67,6 +67,11 @@
             }
             return new Date(v);
         },
+        serialize: function(value) {
+            if (value instanceof Date && !isNaN(value.valueOf())) {
+                return value.getDOY();
+            }
+        }
     }, {
         name: 'gueltigBis',
         type: 'date',
@@ -76,6 +81,11 @@
             }
             return new Date(v);
         },
+        serialize: function(value) {
+            if (value instanceof Date && !isNaN(value.valueOf())) {
+                return value.getDOY();
+            }
+        }
     }, {
         name: 'probeNehmerId'
     }, {

http://lada.wald.intevation.org