Mercurial > lada > lada-client
diff app/model/Messprogramm.js @ 1199:0a7f0a09151c
Replace date-time picker with appropriate widget to select day of year.
Validity period is not specific for a year. The calender widget was
not appropriate here.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 23 Sep 2016 16:49:26 +0200 |
parents | 62f374ea7ab7 |
children | 05c8bd380fd5 |
line wrap: on
line diff
--- a/app/model/Messprogramm.js Fri Sep 23 16:32:30 2016 +0200 +++ b/app/model/Messprogramm.js Fri Sep 23 16:49:26 2016 +0200 @@ -61,70 +61,9 @@ }, { name: 'intervallOffset' }, { - name: 'gueltigVon', - type: 'date', - convert: function(v) { - var firstofyeartimestamp = new Date( - Date.UTC( - new Date().getFullYear(),0,1)) - .valueOf(); - var dayToMilli = 86400000; - - if (!v) { - return v; - } - //check if v might be a date - // unless we go back in time this will work - if (v < 1000) { - v = v * dayToMilli; - v = v + firstofyeartimestamp; - v = new Date(v); - } - return v; - }, - serialize: function(value) { - if (value instanceof Date && !isNaN(value.valueOf())) { - var dayOfYear = Ext.Date.getDayOfYear(value); - var offset = value.getTimezoneOffset(); - if (offset == 0) { - return dayOfYear; - } - return offset > 0 ? dayOfYear - 1 : dayOfYear + 1; - } - } + name: 'gueltigVon' }, { - name: 'gueltigBis', - type: 'date', - convert: function(v) { - var firstofyeartimestamp = new Date( - Date.UTC( - new Date().getFullYear(),0,1)) - .valueOf(); - var dayToMilli = 86400000; - - if (!v) { - return v; - } - - //check if v might be a date - // unless we go back in time this will work - if (v < 1000) { - v = v * dayToMilli; - v = v + firstofyeartimestamp; - v = new Date(v); - } - return v; - }, - serialize: function(value) { - if (value instanceof Date && !isNaN(value.valueOf())) { - var dayOfYear = Ext.Date.getDayOfYear(value); - var offset = value.getTimezoneOffset(); - if (offset == 0) { - return dayOfYear; - } - return offset > 0 ? dayOfYear - 1 : dayOfYear + 1; - } - } + name: 'gueltigBis' }, { name: 'probeNehmerId' }, {