_this.mto.hide();
_this.daypick.hide();
- _this.dateRange = function() {
- return {
- date_from : _this.mfrom.getValue(),
- date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.YEAR, 1).format('Y-m-d')
-
- };
-
- };
+
break;
_this.mfrom.show();
_this.mto.hide();
_this.daypick.hide();
- _this.dateRange = function() {
- return {
- date_from : _this.mfrom.getValue(),
- date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 6).format('Y-m-d')
- };
- };
+
break;
case 'Q':
_this.mfrom.show();
_this.mto.hide();
_this.daypick.hide();
- _this.dateRange = function() {
- return {
- date_from : _this.mfrom.getValue(),
- date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 3).format('Y-m-d')
- };
- };
+
break;
case 'M':
_this.mfrom.show();
_this.mto.hide();
_this.daypick.hide();
- _this.dateRange = function() {
- return {
- date_from : _this.mfrom.getValue(),
- date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 1).format('Y-m-d')
- };
- };
+
break;
_this.mfrom.show();
_this.mto.show();
_this.daypick.hide();
- _this.dateRange = function() {
- return {
- date_from : _this.mfrom.getValue(),
- date_to : _this.mto.getValue()
- };
- };
+
break;
valueField : 'ftype',
width : 150,
dateRange : function() {
- return {
- date_from : _this.mfrom.getValue(),
- date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.YEAR, 1).format('Y-m-d')
-
+
+
+ var ftype = this.getValue();
+
+ switch(ftype) {
+ case 'Y':
+
+
+ return {
+ date_from : _this.mfrom.getValue(),
+ date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.YEAR, 1).format('Y-m-d')
+
+ };
+ ;
+
+
+ break;
+ case 'H':
+ //
+ return {
+ date_from : _this.mfrom.getValue(),
+ date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 6).format('Y-m-d')
+ };
+
+ break;
+ case 'Q':
+
+
+
+ return {
+ date_from : _this.mfrom.getValue(),
+ date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 3).format('Y-m-d')
};
+
+ break;
+
+ case 'M':
+
+ return {
+ date_from : _this.mfrom.getValue(),
+ date_to :Date.parseDate(_this.mfrom.getValue(), 'Y-n-d').add(Date.MONTH, 1).format('Y-m-d')
+ };
+
+
+
+
+
+ case 'R':
+
+ return {
+ date_from : _this.mfrom.getValue(),
+ date_to : _this.mto.getValue()
+ };
+
+
+ break;
+
+ default:
+ Roo.MessageBox.alert("select range");
+ return;
+ }
+
},
store : {
xtype: 'SimpleStore',