View | Details | Raw Unified | Return to bug 9061
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.date-euro.js (+44 lines)
Line 0 Link Here
1
/* Adapted from  sorting plugin found at http://datatables.net/plug-ins/sorting,
2
  "Date (dd/mm/YYY hh:ii:ss)," by Ronan Guilloux. Original plugin did not
3
  account for variation in input string */
4
5
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
6
    "date-euro-pre": function ( a ) {
7
        // function should work with strings like "dd/mm/yyyy hh:mm:ss" or "dd/mm/yyyy"
8
        // function doesn't validate the date, just checks for valid structure
9
        var x;
10
        var dateTimeParts;
11
        var dateParts;
12
        var timeParts;
13
        if ($.trim(a) !== '') {
14
            dateTimeParts = $.trim(a).split(' ');
15
            dateParts = dateTimeParts[0].split('/');
16
            if( dateParts.length == 3 ){
17
                // validish date format
18
                if( dateTimeParts.length > 1){
19
                    // there is a time portion
20
                    timeParts = dateTimeParts[1].split(':');
21
                    if( timeParts.length > 1 ){
22
                        // validish time portion
23
                        x = (dateParts[2] + dateParts[1] + dateParts[0] + timeParts[0] + timeParts[1] + timeParts[2]) * 1;
24
                    }
25
                } else {
26
                    x = (dateParts[2] + dateParts[1] + dateParts[0]) * 1;
27
                }
28
            } else {
29
                x = 10000000000000; // = l'an 1000 ...
30
            }
31
        } else {
32
                x = 10000000000000; // = l'an 1000 ...
33
        }
34
        return x;
35
    },
36
 
37
    "date-euro-asc": function ( a, b ) {
38
        return a - b;
39
    },
40
 
41
    "date-euro-desc": function ( a, b ) {
42
        return b - a;
43
    }
44
} );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-3 / +6 lines)
Lines 1-15 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>
3
<title>Circulation history for [% INCLUDE 'patron-title.inc' %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
5
<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
6
<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
6
<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7
[% INCLUDE 'datatables-strings.inc' %]
7
[% INCLUDE 'datatables-strings.inc' %]
8
<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
8
<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
9
[% IF ( dateformat_metric ) %]<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.date-euro.js"></script>[% END %]
9
<script type="text/javascript" id="js">$(document).ready(function() {
10
<script type="text/javascript" id="js">$(document).ready(function() {
10
 $(document).ready(function() {
11
 $(document).ready(function() {
11
    $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
12
    $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
12
        "sPaginationType": "four_button",
13
        "sPaginationType": "four_button"
14
        [% IF ( dateformat_metric ) %], "aoColumnDefs": [
15
        { "sType": "date-euro", "aTargets": [ 0,6,8,9 ] }
16
        ][% END %]
13
    }));
17
    }));
14
 });
18
 });
15
}); </script>
19
}); </script>
16
- 

Return to bug 9061