changeset 303:eb483558bce4

Use ts2date function from lib.Helpers. Remove old code
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 09 Aug 2013 15:24:00 +0200
parents c7f0bf80761b
children 8475a625a773
files app/model/Ort.js
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Ort.js	Fri Aug 09 15:24:00 2013 +0200
+++ b/app/model/Ort.js	Fri Aug 09 15:24:00 2013 +0200
@@ -1,5 +1,6 @@
 Ext.define('Lada.model.Ort', {
     extend: 'Ext.data.Model',
+    requires: ['Lada.lib.Helpers'],
     fields: [
         // Field from the l_ort table
         {name: "portId", type: 'int'},
@@ -7,7 +8,7 @@
         {name: "probeId"},
         {name: "ortsTyp"},
         {name: "ortszusatztext"},
-        {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()}
+        {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}
     ],
     idProperty: "portId",
     proxy: {
@@ -27,8 +28,3 @@
         return "/" + ortId + "/" + probeId;
     }
 });
-
-function ts2date(v, record){
-    // Converts a timestamp into a date object.
-    return new Date(v);
-}

http://lada.wald.intevation.org