← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7556: Limit range to select dates for start-date and end-date in tabular report.

 

------------------------------------------------------------
revno: 7556
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-07-10 15:10:27 +0700
message:
  Limit range to select dates for start-date and end-date in tabular report.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-07-09 08:32:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2012-07-10 08:10:27 +0000
@@ -1710,9 +1710,14 @@
 										width: TR.conf.layout.west_fieldset_width / 2 - 4,
 										format: TR.i18n.format_date,
 										value: new Date((new Date()).setMonth((new Date()).getMonth()-3)),
+										maxValue: new Date(),
 										listeners: {
 											added: function() {
 												TR.cmp.settings.startDate = this;
+											},
+											change:function(){
+												var startDate =  TR.cmp.settings.startDate.getValue();
+												Ext.getCmp('endDate').setMinValue(startDate);
 											}
 										}
 									},
@@ -1731,9 +1736,14 @@
 										width: TR.conf.layout.west_fieldset_width / 2 - 4,
 										format: TR.i18n.format_date,
 										value: new Date(),
+										minValue: new Date((new Date()).setMonth((new Date()).getMonth()-3)),
 										listeners: {
 											added: function() {
 												TR.cmp.settings.endDate = this;
+											},
+											change:function(){
+												var endDate =  TR.cmp.settings.endDate.getValue();
+												Ext.getCmp('startDate').setMaxValue( endDate );
 											}
 										}
 									}