changeset 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 b3e38a2a25c7
children a0cfe2395e0a
files app/model/Messprogramm.js
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
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