comparison app/model/Ort.js @ 303:eb483558bce4

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 4db982514a5f
children 0a5f6db02965
comparison
equal deleted inserted replaced
302:c7f0bf80761b 303:eb483558bce4
1 Ext.define('Lada.model.Ort', { 1 Ext.define('Lada.model.Ort', {
2 extend: 'Ext.data.Model', 2 extend: 'Ext.data.Model',
3 requires: ['Lada.lib.Helpers'],
3 fields: [ 4 fields: [
4 // Field from the l_ort table 5 // Field from the l_ort table
5 {name: "portId", type: 'int'}, 6 {name: "portId", type: 'int'},
6 {name: "ortId", type: 'int'}, 7 {name: "ortId", type: 'int'},
7 {name: "probeId"}, 8 {name: "probeId"},
8 {name: "ortsTyp"}, 9 {name: "ortsTyp"},
9 {name: "ortszusatztext"}, 10 {name: "ortszusatztext"},
10 {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()} 11 {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}
11 ], 12 ],
12 idProperty: "portId", 13 idProperty: "portId",
13 proxy: { 14 proxy: {
14 type: 'rest', 15 type: 'rest',
15 appendId: true, //default 16 appendId: true, //default
25 var ortId = this.get('portId'); 26 var ortId = this.get('portId');
26 var probeId = this.get('probeId'); 27 var probeId = this.get('probeId');
27 return "/" + ortId + "/" + probeId; 28 return "/" + ortId + "/" + probeId;
28 } 29 }
29 }); 30 });
30
31 function ts2date(v, record){
32 // Converts a timestamp into a date object.
33 return new Date(v);
34 }

http://lada.wald.intevation.org