Mercurial > lada > lada-client
comparison app/model/Probe.js @ 304:8475a625a773
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 | d18465f7b66a |
children | 4c4f03c87d49 |
comparison
equal
deleted
inserted
replaced
303:eb483558bce4 | 304:8475a625a773 |
---|---|
2 * A Probe. | 2 * A Probe. |
3 * This class represents and defines the model of a "Probe" | 3 * This class represents and defines the model of a "Probe" |
4 * */ | 4 * */ |
5 Ext.define('Lada.model.Probe', { | 5 Ext.define('Lada.model.Probe', { |
6 extend: 'Ext.data.Model', | 6 extend: 'Ext.data.Model', |
7 requires: ['Lada.lib.Helpers'], | |
7 fields: [ | 8 fields: [ |
8 {name: "probeId"}, | 9 {name: "probeId"}, |
9 {name: "baId"}, | 10 {name: "baId"}, |
10 {name: "datenbasisId"}, | 11 {name: "datenbasisId"}, |
11 {name: "erzeugerId"}, | 12 {name: "erzeugerId"}, |
12 {name: "hauptprobenNr"}, | 13 {name: "hauptprobenNr"}, |
13 {name: "messmethode"}, | 14 {name: "messmethode"}, |
14 {name: "nebenprobenNr"}, | 15 {name: "nebenprobenNr"}, |
15 {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()}, | 16 {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, |
16 {name: "media"}, | 17 {name: "media"}, |
17 {name: "mediaDesk"}, | 18 {name: "mediaDesk"}, |
18 {name: "mittelungsdauer"}, | 19 {name: "mittelungsdauer"}, |
19 {name: "mpKat"}, | 20 {name: "mpKat"}, |
20 {name: "mplId"}, | 21 {name: "mplId"}, |
21 {name: "mprId"}, | 22 {name: "mprId"}, |
22 {name: "mstId"}, | 23 {name: "mstId"}, |
23 {name: "netzbetreiberId"}, | 24 {name: "netzbetreiberId"}, |
24 {name: "probeNehmerId"}, | 25 {name: "probeNehmerId"}, |
25 {name: "probeentnahmeBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, | 26 {name: "probeentnahmeBeginn", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, |
26 {name: "probeentnahmeEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, | 27 {name: "probeentnahmeEnde", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, |
27 {name: "probenartId"}, | 28 {name: "probenartId"}, |
28 {name: "solldatumBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, | 29 {name: "solldatumBeginn", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, |
29 {name: "solldatumEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, | 30 {name: "solldatumEnde", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, |
30 {name: "test"}, | 31 {name: "test"}, |
31 {name: "umwId"}, | 32 {name: "umwId"}, |
32 | 33 |
33 // Readonly-Flag (sent additionaly by the server, not part of the | 34 // Readonly-Flag (sent additionaly by the server, not part of the |
34 // model) | 35 // model) |
43 type: 'json', | 44 type: 'json', |
44 root: 'data' | 45 root: 'data' |
45 } | 46 } |
46 } | 47 } |
47 }); | 48 }); |
48 | |
49 function buildId(v, record){ | |
50 var newId = record.get('probeId') + record.get('nebenprobenNr'); | |
51 return newId; | |
52 } | |
53 | |
54 function ts2date(v, record){ | |
55 // Converts a timestamp into a date object. | |
56 return new Date(v); | |
57 } |