[Lada-commits] [PATCH 20 of 56] Use ts2date function from lib.Helpers. Remove old code

Wald Commits scm-commit at wald.intevation.org
Tue Aug 13 09:53:46 CEST 2013


# HG changeset patch
# User Torsten Irländer <torsten.irlaender at intevation.de>
# Date 1376054640 -7200
# Node ID 8475a625a7739a9fa7b3e027808cefffe574f4e4
# Parent  eb483558bce4d8793c7f2a923f9cecf779361d42
Use ts2date function from lib.Helpers. Remove old code

diff -r eb483558bce4 -r 8475a625a773 app/model/Probe.js
--- a/app/model/Probe.js	Fri Aug 09 15:24:00 2013 +0200
+++ b/app/model/Probe.js	Fri Aug 09 15:24:00 2013 +0200
@@ -4,6 +4,7 @@
  * */
 Ext.define('Lada.model.Probe', {
     extend: 'Ext.data.Model',
+    requires: ['Lada.lib.Helpers'],
     fields: [
         {name: "probeId"},
         {name: "baId"},
@@ -12,7 +13,7 @@
         {name: "hauptprobenNr"},
         {name: "messmethode"},
         {name: "nebenprobenNr"},
-        {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
         {name: "media"},
         {name: "mediaDesk"},
         {name: "mittelungsdauer"},
@@ -22,11 +23,11 @@
         {name: "mstId"},
         {name: "netzbetreiberId"},
         {name: "probeNehmerId"},
-        {name: "probeentnahmeBeginn", type: 'date', convert: ts2date, defaultValue: new Date()},
-        {name: "probeentnahmeEnde", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "probeentnahmeBeginn", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
+        {name: "probeentnahmeEnde", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
         {name: "probenartId"},
-        {name: "solldatumBeginn", type: 'date', convert: ts2date, defaultValue: new Date()},
-        {name: "solldatumEnde", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "solldatumBeginn", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
+        {name: "solldatumEnde", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
         {name: "test"},
         {name: "umwId"},
 
@@ -45,13 +46,3 @@
         }
     }
 });
-
-function buildId(v, record){
-    var newId = record.get('probeId') + record.get('nebenprobenNr');
-    return newId;
-}
-
-function ts2date(v, record){
-    // Converts a timestamp into a date object.
-    return new Date(v);
-}


More information about the Lada-commits mailing list