changeset 308:59c1d9ad6555

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 5f373d9d55cd
children 51897f9a6bbb
files app/model/Status.js
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/app/model/Status.js	Fri Aug 09 15:24:00 2013 +0200
+++ b/app/model/Status.js	Fri Aug 09 15:24:00 2013 +0200
@@ -1,12 +1,13 @@
 Ext.define('Lada.model.Status', {
     extend: 'Ext.data.Model',
+    requires: ['Lada.lib.Helpers'],
     fields: [
         {name: "sid"},
         {name: "messungsId"},
         {name: "probeId"},
         {name: "erzeuger"},
         {name: "status", defaultValue: 1},
-        {name: "sdatum", type: 'date', convert: ts2date, defaultValue: new Date()},
+        {name: "sdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
         {name: "skommentar"}
     ],
     idProperty: "sid",
@@ -26,8 +27,3 @@
         return "/" + sid + "/" + messId + "/" + probeId;
     }
 });
-
-function ts2date(v, record){
-    // Converts a timestamp into a date object.
-    return new Date(v);
-}

http://lada.wald.intevation.org