Mercurial > lada > lada-client
changeset 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 | eb483558bce4 |
children | 2af694c73dd7 |
files | app/model/Probe.js |
diffstat | 1 files changed, 6 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/app/model/Probe.js Fri Aug 09 15:24:00 2013 +0200 +++ b/app/model/Probe.js Fri Aug 09 15:24:00 2013 +0200 @@ -4,6 +4,7 @@ * */ Ext.define('Lada.model.Probe', { extend: 'Ext.data.Model', + requires: ['Lada.lib.Helpers'], fields: [ {name: "probeId"}, {name: "baId"}, @@ -12,7 +13,7 @@ {name: "hauptprobenNr"}, {name: "messmethode"}, {name: "nebenprobenNr"}, - {name: "letzteAenderung", type: 'date', convert: ts2date, defaultValue: new Date()}, + {name: "letzteAenderung", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, {name: "media"}, {name: "mediaDesk"}, {name: "mittelungsdauer"}, @@ -22,11 +23,11 @@ {name: "mstId"}, {name: "netzbetreiberId"}, {name: "probeNehmerId"}, - {name: "probeentnahmeBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, - {name: "probeentnahmeEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, + {name: "probeentnahmeBeginn", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, + {name: "probeentnahmeEnde", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, {name: "probenartId"}, - {name: "solldatumBeginn", type: 'date', convert: ts2date, defaultValue: new Date()}, - {name: "solldatumEnde", type: 'date', convert: ts2date, defaultValue: new Date()}, + {name: "solldatumBeginn", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, + {name: "solldatumEnde", type: 'date', convert: Lada.lib.Helpers.ts2date, defaultValue: new Date()}, {name: "test"}, {name: "umwId"}, @@ -45,13 +46,3 @@ } } }); - -function buildId(v, record){ - var newId = record.get('probeId') + record.get('nebenprobenNr'); - return newId; -} - -function ts2date(v, record){ - // Converts a timestamp into a date object. - return new Date(v); -}