← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8737: Mobile: fixed bug with invalid date on some mobiles

 

------------------------------------------------------------
revno: 8737
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-10-26 15:58:54 +0200
message:
  Mobile: fixed bug with invalid date on some mobiles
modified:
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm
  dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm


--
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-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm	2012-10-24 15:15:23 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm	2012-10-26 13:58:54 +0000
@@ -14,18 +14,15 @@
     var allowFuturePeriods = false;
 
     function selectOrganisationUnit( e ) {
-        var $this = $(this);
-        Selected.orgUnit = $this.data('id');
+        Selected.orgUnit = $(this).data('id');
     }
 
     function selectDataSet( e ) {
-        var $this = $(this);
-        Selected.dataSet = $this.data('id');
+        Selected.dataSet = $(this).data('id');
     }
 
     function selectPeriod( e ) {
-        var $this = $(this);
-        Selected.period = $this.data('id');
+        Selected.period = $(this).data('id');
     }
 
     function loadOrganisationUnitsPage() {

=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm	2012-10-23 12:20:27 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/message.vm	2012-10-26 13:58:54 +0000
@@ -1,5 +1,16 @@
 
 <script>
+    function getDate( isoDate ) {
+        var d = new Date( isoDate ).toDateString();
+
+        if( d == "Invalid Date" )
+        {
+            d = isoDate.substring(0, 10);
+        }
+
+        return d;
+    }
+
     function bindSubmitHandler() {
         $('#reply-form input:submit').bind('click', function ( e ) {
             var msg = jQuery('#reply-text').val();
@@ -52,7 +63,7 @@
     <ul data-role="listview" data-inset="true">
         <li data-role="list-divider"><%= subject %></li>
         <% _( _( messages ).reverse() ).each( function(message, idx) { %>
-        <% var d = new Date( message.lastUpdated ).toDateString(); %>
+        <% var d = getDate( message.lastUpdated ); %>
         <li>
             <h3><%= message.sender.name %></h3>
             <p style="white-space: normal !important"><%= message.name %></p>