=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js 2014-04-29 14:29:01 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.period.js 2014-04-29 14:50:30 +0000 @@ -83,8 +83,12 @@ var $toEl = $(toEl); mergedOptions.onSelect = function( dates ) { - $fromEl.calendarsPicker("option", "maxDate", dates[0] || null); - $toEl.calendarsPicker("option", "minDate", dates[0] || null); + if( this.id === $fromEl.attr('id') ) { + $toEl.calendarsPicker("option", "minDate", dates[0] || null); + } + else if( this.id === $toEl.attr('id') ) { + $fromEl.calendarsPicker("option", "maxDate", dates[0] || null); + } }; $fromEl.calendarsPicker(mergedOptions); @@ -94,6 +98,9 @@ }); $toEl.calendarsPicker(toOptions); + + $fromEl.calendarsPicker("setDate", $fromEl.calendarsPicker("getDate")); + $toEl.calendarsPicker("setDate", $toEl.calendarsPicker("getDate")); }; /**