diff app/view/window/GenProbenFromMessprogramm.js @ 1191:62f374ea7ab7

Use UTC date in messprogramm to generate probe objects.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 07 Sep 2016 17:16:26 +0200
parents b98e3af27424
children 39d98891881c
line wrap: on
line diff
--- a/app/view/window/GenProbenFromMessprogramm.js	Wed Aug 31 15:56:07 2016 +0200
+++ b/app/view/window/GenProbenFromMessprogramm.js	Wed Sep 07 17:16:26 2016 +0200
@@ -48,13 +48,18 @@
         }, {
             text: i18n.getMsg('generateproben'),
             handler: function() {
+                var startDate = new Date(me.down('datefield[name=start]').getValue());
+                var startUTC = Date.UTC(
+                    startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
+                var endDate = new Date(me.down('datefield[name=end]').getValue());
+                var endUTC = Date.UTC(
+                    endDate.getFullYear(), endDate.getMonth(), endDate.getDate());
                 var jsondata = {
                     id: me.record.id,
-                    start: new Date(me.down('datefield[name=start]').getValue()).valueOf(),
-                    end: new Date(me.down('datefield[name=end]').getValue()).valueOf()
+                    start: startUTC,
+                    end: endUTC
                 };
 
-
                 Ext.Ajax.request({
                     url: 'lada-server/rest/probe/messprogramm',
                     method: 'POST',

http://lada.wald.intevation.org