changeset 298:53a446d4f424

Use ts2date function from lib.Helpers. Remove old code
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 09 Aug 2013 15:23:59 +0200
parents 1e1ee8abf91b
children fe199b8828a8
files app/model/Kommentar.js
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Kommentar.js	Fri Aug 09 15:22:09 2013 +0200
+++ b/app/model/Kommentar.js	Fri Aug 09 15:23:59 2013 +0200
@@ -1,10 +1,11 @@
 Ext.define('Lada.model.Kommentar', {
     extend: 'Ext.data.Model',
+    requires: ['Lada.lib.Helpers'],
     fields: [
         {name: "kId"},
         {name: "probeId"},
         {name: "erzeuger"},
-        {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "kdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
         {name: "ktext"}
     ],
     idProperty: "kId",
@@ -23,8 +24,3 @@
         return "/" + kid + "/" + probeId;
     }
 });
-
-function ts2date(v, record){
-    // Converts a timestamp into a date object.
-    return new Date(v);
-}

http://lada.wald.intevation.org