Fix sorting by date in datatables
authorKevin Levie <kevin@levity.nl>
Wed, 19 Aug 2015 04:34:09 +0000 (06:34 +0200)
committerKevin Levie <kevin@levity.nl>
Wed, 19 Aug 2015 04:49:13 +0000 (06:49 +0200)
templates/CRM/Contact/Page/View/GroupContact.tpl
templates/CRM/Contact/Page/View/Note.tpl
templates/CRM/Event/Form/ManageEvent/Repeat.tpl
templates/CRM/Event/Page/ManageEvent.tpl
templates/CRM/Member/Form/MembershipRelated.tpl
templates/CRM/Member/Page/Tab.tpl

index e8a80c89d11fe3129839e7e158934d6d494cfc70..ebf7264057f7783ca16167de947ae0c9c874430e 100644 (file)
               </a>
             </td>
             <td class="status-removed">{ts 1=$row.out_method}Removed (by %1){/ts}</td>
-            <td>{$row.date_added|crmDate}</td>
-            <td>{$row.out_date|crmDate}</td>
+            <td data-order="{$row.date_added}">{$row.date_added|crmDate}</td>
+            <td data-order="{$row.out_date}">{$row.out_date|crmDate}</td>
             <td>{if $permission EQ 'edit'}
                 <a class="action-item crm-hover-button" href="#Added" title="{ts 1=$displayName 2=$row.title}Add %1 back into %2?{/ts}">
                   {ts}Rejoin Group{/ts}</a>
index 1bc63cb9fe604da9505137726279b7d782da99e7..fda7ceb3de1d662628042fe4d6acb48978a2737c 100644 (file)
                 {/if}
             </td>
             <td class="crm-note-subject">{$note.subject}</td>
-            <td class="crm-note-modified_date">{$note.modified_date|crmDate}</td>
+            <td class="crm-note-modified_date" data-order="{$note.modified_date}">{$note.modified_date|crmDate}</td>
             <td class="crm-note-createdBy">
                 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$note.contact_id`"}">{$note.createdBy}</a>
             </td>
index 8ebcf77bc7ff144435e6c146b9fb0e54b0c1667b..079ab6ec0145d33a5347d7b3bd1de35e939e8c75 100644 (file)
@@ -57,8 +57,8 @@
                title="{ts}View event info page{/ts}" class="bold">{$row.title}</a>&nbsp;&nbsp;({ts}ID:{/ts} {$row.id})
           </td>
           <td class="crm-event-is_public{$highlight}">{if $row.is_public eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
-          <td class="crm-event-start_date{$highlight}">{$row.start_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
-          <td class="crm-event-end_date{$highlight}">{$row.end_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
+              <td class="crm-event-start_date{$highlight}" data-order="{$row.start_date|crmDate:'%Y-%m-%d'}">{$row.start_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
+              <td class="crm-event-end_date{$highlight}" data-order="{$row.end_date|crmDate:'%Y-%m-%d'}">{$row.end_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
           <td class="crm-event_status{$highlight}" id="row_{$row.id}_status">
             {if $row.is_active eq 1}{ts}Yes{/ts} {else} {ts}No{/ts} {/if}
           </td>
index de39966455e1cb5318226f70049cb193b7e3ab91..1cb8d7f536a284c674d5027dbf98cd5a42625410 100644 (file)
@@ -93,8 +93,8 @@
           <td class="crm-event-state_province">{$row.state_province}</td>
           <td class="crm-event-event_type">{$row.event_type}</td>
           <td class="crm-event-is_public">{if $row.is_public eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
-          <td class="crm-event-start_date">{$row.start_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
-          <td class="crm-event-end_date">{$row.end_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
+          <td class="crm-event-start_date" data-order="{$row.start_date|crmDate:'%Y-%m-%d'}">{$row.start_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
+          <td class="crm-event-end_date" data-order="{$row.end_date|crmDate:'%Y-%m-%d'}">{$row.end_date|crmDate:"%b %d, %Y %l:%M %P"}</td>
           {if call_user_func(array('CRM_Campaign_BAO_Campaign','isCampaignEnable'))}
             <td class="crm-event-campaign">{$row.campaign}</td>
           {/if}
index 033394f75c8a4a82ae55eae509cd74ea9a58c49d..bb1fff88ecd07ae3c2d08e84b04abd80847f2104 100644 (file)
@@ -47,8 +47,8 @@
                             <td>
                                 <a href="{crmURL p='civicrm/contact/view/rel' q="action=view&reset=1&selectedChild=rel&cid=`$rel.cid`&id=`$rel.id`"}">{$rel.relation}</a>
                             </td>
-                            <td>{$rel.start_date|crmDate}</td>
-                            <td>{$rel.end_date|crmDate}</td>
+                            <td data-order="{$rel.start_date}">{$rel.start_date|crmDate}</td>
+                            <td data-order="{$rel.end_date}">{$rel.end_date|crmDate}</td>
                             <td class="bold">
                                 <a href="{crmURL p='civicrm/contact/view' q="action=view&reset=1&cid=`$rel.cid`"}">{$rel.name}</a>
                             </td>
index e4b2cb255218f95a20665c80b3c797923d3fd84d..07970fa4e3479119d5919204d4a9fd8b75316f0c 100644 (file)
@@ -89,9 +89,9 @@
                     {$activeMember.membership_type}
                     {if $activeMember.owner_membership_id}<br />({ts}by relationship{/ts}){/if}
                 </td>
-                <td class="crm-membership-join_date">{$activeMember.join_date|crmDate}</td>
-                <td class="crm-membership-start_date">{$activeMember.start_date|crmDate}</td>
-                <td class="crm-membership-end_date">{$activeMember.end_date|crmDate}</td>
+                <td class="crm-membership-join_date" data-order="{$activeMember.join_date}">{$activeMember.join_date|crmDate}</td>
+                <td class="crm-membership-start_date" data-order="{$activeMember.start_date}">{$activeMember.start_date|crmDate}</td>
+                <td class="crm-membership-end_date" data-order="{$activeMember.end_date}">{$activeMember.end_date|crmDate}</td>
                 <td class="crm-membership-status">{$activeMember.status}</td>
                 <td class="crm-membership-source">{$activeMember.source}</td>
                 <td class="crm-membership-auto_renew">{if $activeMember.auto_renew}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Auto-renew{/ts}" /> {/if}</td>
                 <td class="crm-membership-membership_type">{$inActiveMember.membership_type}
         {if $inActiveMember.owner_membership_id}<br />({ts}by relationship{/ts}){/if}
     </td>
-                <td class="crm-membership-start_date">{$inActiveMember.start_date|crmDate}</td>
-                <td class="crm-membership-end_date">{$inActiveMember.end_date|crmDate}</td>
+                <td class="crm-membership-start_date" data-order="{$inActiveMember.start_date}">{$inActiveMember.start_date|crmDate}</td>
+                <td class="crm-membership-end_date" data-order="{$inActiveMember.end_date}">{$inActiveMember.end_date|crmDate}</td>
                 <td class="crm-membership-status">{$inActiveMember.status}</td>
                 <td class="crm-membership-source">{$inActiveMember.source}</td>
                 <td class="crm-membership-auto_renew">{if $inActiveMember.auto_renew}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Auto-renew{/ts}" /> {/if}</td>