comparison app/model/MKommentar.js @ 301:7b30c20ad1aa

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 d3f4a39bf89e
children 7de16725d251
comparison
equal deleted inserted replaced
300:66935692f4b9 301:7b30c20ad1aa
1 Ext.define('Lada.model.MKommentar', { 1 Ext.define('Lada.model.MKommentar', {
2 extend: 'Ext.data.Model', 2 extend: 'Ext.data.Model',
3 requires: ['Lada.lib.Helpers'],
3 fields: [ 4 fields: [
4 {name: "id"}, 5 {name: "id"},
5 {name: "kid"}, 6 {name: "kid"},
6 {name: "messungsId"}, 7 {name: "messungsId"},
7 {name: "probeId"}, 8 {name: "probeId"},
8 {name: "erzeuger"}, 9 {name: "erzeuger"},
9 {name: "kdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, 10 {name: "kdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
10 {name: "ktext"} 11 {name: "ktext"}
11 ], 12 ],
12 idProperty: "id", 13 idProperty: "id",
13 proxy: { 14 proxy: {
14 type: 'rest', 15 type: 'rest',
24 var messId = this.get('messungsId'); 25 var messId = this.get('messungsId');
25 var probeId = this.get('probeId'); 26 var probeId = this.get('probeId');
26 return "/" + kid + "/" + messId + "/" + probeId; 27 return "/" + kid + "/" + messId + "/" + probeId;
27 } 28 }
28 }); 29 });
29
30 function ts2date(v, record){
31 // Converts a timestamp into a date object.
32 return new Date(v);
33 }

http://lada.wald.intevation.org