← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16748: tracker capture - some control on datepicker

 

------------------------------------------------------------
revno: 16748
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-09-18 16:07:34 +0200
message:
  tracker capture - some control on datepicker
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html


--
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-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-09-08 13:35:02 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-09-18 14:07:34 +0000
@@ -72,12 +72,14 @@
                             {{selectedProgram.dateOfEnrollmentDescription}}
                         </td>
                         <td class="col-md-6">
-                            <span ng-if="selectedProgram.selectEnrollmentDatesInFuture">
-                                <input type="text" placeholder="yyyy-mm-dd" name="dateOfEnrollment" class="form-control" ng-date ng-model="newEnrollment.dateOfEnrollment" ng-required="true"/>
-                            </span>
-                            <span ng-if="!selectedProgram.selectEnrollmentDatesInFuture">
-                                <input type="text" placeholder="yyyy-mm-dd" name="dateOfEnrollment" class="form-control" ng-date ng-model="newEnrollment.dateOfEnrollment" max-date="today" ng-required="true"/>
-                            </span>
+                            <input type="text" 
+                                   placeholder="yyyy-mm-dd" 
+                                   name="dateOfEnrollment" 
+                                   class="form-control" 
+                                   ng-date 
+                                   max-date="selectedProgram.selectEnrollmentDatesInFuture ? '' : today"
+                                   ng-model="newEnrollment.dateOfEnrollment" 
+                                   ng-required="true"/>
                             <span ng-show="outerForm.submitted && outerForm.dateOfEnrollment.$invalid" class="red">{{'required'| translate}}</span>
                         </td>
                     </tr>     
@@ -86,12 +88,13 @@
                             {{selectedProgram.dateOfIncidentDescription}}
                         </td>
                         <td class="col-md-6">
-                            <span ng-if="selectedProgram.selectIncidentDatesInFuture">
-                                <input type="text" placeholder="yyyy-mm-dd" class="form-control" ng-date ng-model="newEnrollment.dateOfIncident" />                        
-                            </span>
-                            <span ng-if="!selectedProgram.selectIncidentDatesInFuture">
-                                <input type="text" placeholder="yyyy-mm-dd" class="form-control" ng-date ng-model="newEnrollment.dateOfIncident" max-date="today"/>                        
-                            </span>
+                            <input type="text" 
+                                   placeholder="yyyy-mm-dd" 
+                                   class="form-control" 
+                                   ng-date
+                                   max-date="selectedProgram.selectIncidentDatesInFuture ? '' : today"
+                                   ng-model="newEnrollment.dateOfIncident" 
+                                   max-date="today"/>
                         </td>
                     </tr>
                 </table>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html	2014-09-07 08:30:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration.html	2014-09-18 14:07:34 +0000
@@ -76,12 +76,14 @@
                         {{selectedProgram.dateOfEnrollmentDescription}}
                     </td>
                     <td>
-                        <span ng-if="selectedProgram.selectEnrollmentDatesInFuture">
-                            <input type="text" placeholder="yyyy-mm-dd" name="dateOfEnrollment" class="form-control" ng-date ng-model="enrollment.enrollmentDate" ng-required="true"/>
-                        </span>                        
-                        <span ng-if="!selectedProgram.selectEnrollmentDatesInFuture">
-                            <input type="text" placeholder="yyyy-mm-dd" name="dateOfEnrollment" class="form-control" ng-date ng-model="enrollment.enrollmentDate" max-date="today" ng-required="true"/>
-                        </span>
+                        <input type="text" 
+                               placeholder="yyyy-mm-dd" 
+                               name="dateOfEnrollment" 
+                               class="form-control" 
+                               ng-date 
+                               ng-model="enrollment.enrollmentDate" 
+                               max-date="selectedProgram.selectEnrollmentDatesInFuture ? '' : today" 
+                               ng-required="true"/>
                         <span ng-show="outerForm.submitted && outerForm.dateOfEnrollment.$invalid" class="error">{{'required'| translate}}</span>
                     </td>
                 </tr>     
@@ -90,12 +92,12 @@
                         {{selectedProgram.dateOfIncidentDescription}}
                     </td>
                     <td>
-                        <span ng-if="selectedProgram.selectIncidentDatesInFuture">
-                            <input type="text" placeholder="yyyy-mm-dd" class="form-control" ng-date ng-model="enrollment.incidentDate" />
-                        </span>                        
-                        <span ng-if="!selectedProgram.selectIncidentDatesInFuture">
-                            <input type="text" placeholder="yyyy-mm-dd" class="form-control" ng-date ng-model="enrollment.incidentDate" max-date="today"/>
-                        </span>
+                        <input type="text" 
+                               placeholder="yyyy-mm-dd" 
+                               class="form-control" 
+                               ng-date 
+                               max-date="selectedProgram.selectIncidentDatesInFuture ? '' : today"
+                               ng-model="enrollment.incidentDate"/>
                     </td>
                 </tr>
             </table>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html	2014-09-18 13:36:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html	2014-09-18 14:07:34 +0000
@@ -92,12 +92,12 @@
                                    class="form-control" 
                                    ng-date 
                                    ng-model="report.startDate" 
-                                   max="today" 
+                                   min-date="today" 
                                    ng-required="true"/> 
                             <span ng-show="outerForm.submitted && outerForm.reportStartDate.$invalid" style="color:red;font-size:12px">{{'required'| translate}} (yyyy-mm-dd)</span>
                         </td>
                         <td>
-                            <input type="text" name="reportEndDate" placeholder="{{'end_date'| translate}} (yyyy-mm-dd)" class="form-control" ng-date ng-model="report.endDate" max="today" ng-required="true"/>
+                            <input type="text" name="reportEndDate" placeholder="{{'end_date'| translate}} (yyyy-mm-dd)" class="form-control" ng-date ng-model="report.endDate" min-date="today" ng-required="true"/>
                             <span ng-show="outerForm.submitted && outerForm.reportEndDate.$invalid" style="color:red;font-size:12px">{{'required'| translate}} (yyyy-mm-dd)</span>
                         </td>
                     </tr>