comparison app/model/Status.js @ 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 d27017394c8f
children 49a42c7f1d1f
comparison
equal deleted inserted replaced
307:5f373d9d55cd 308:59c1d9ad6555
1 Ext.define('Lada.model.Status', { 1 Ext.define('Lada.model.Status', {
2 extend: 'Ext.data.Model', 2 extend: 'Ext.data.Model',
3 requires: ['Lada.lib.Helpers'],
3 fields: [ 4 fields: [
4 {name: "sid"}, 5 {name: "sid"},
5 {name: "messungsId"}, 6 {name: "messungsId"},
6 {name: "probeId"}, 7 {name: "probeId"},
7 {name: "erzeuger"}, 8 {name: "erzeuger"},
8 {name: "status", defaultValue: 1}, 9 {name: "status", defaultValue: 1},
9 {name: "sdatum", type: 'date', convert: ts2date, defaultValue: new Date()}, 10 {name: "sdatum", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()},
10 {name: "skommentar"} 11 {name: "skommentar"}
11 ], 12 ],
12 idProperty: "sid", 13 idProperty: "sid",
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 "/" + sid + "/" + messId + "/" + probeId; 27 return "/" + sid + "/" + 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