comparison app/model/Kommentar.js @ 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 7b1140bd8b3d
children fcbd60412ba8
comparison
equal deleted inserted replaced
297:1e1ee8abf91b 298:53a446d4f424
1 Ext.define('Lada.model.Kommentar', { 1 Ext.define('Lada.model.Kommentar', {
2 extend: 'Ext.data.Model', 2 extend: 'Ext.data.Model',
3 requires: ['Lada.lib.Helpers'],
3 fields: [ 4 fields: [
4 {name: "kId"}, 5 {name: "kId"},
5 {name: "probeId"}, 6 {name: "probeId"},
6 {name: "erzeuger"}, 7 {name: "erzeuger"},
7 {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, 8 {name: "kdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
8 {name: "ktext"} 9 {name: "ktext"}
9 ], 10 ],
10 idProperty: "kId", 11 idProperty: "kId",
11 proxy: { 12 proxy: {
12 type: 'rest', 13 type: 'rest',
21 var kid = this.get('kId'); 22 var kid = this.get('kId');
22 var probeId = this.get('probeId'); 23 var probeId = this.get('probeId');
23 return "/" + kid + "/" + probeId; 24 return "/" + kid + "/" + probeId;
24 } 25 }
25 }); 26 });
26
27 function ts2date(v, record){
28 // Converts a timestamp into a date object.
29 return new Date(v);
30 }

http://lada.wald.intevation.org