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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc (-2 / +3 lines)
Lines 42-50 Link Here
42
         */
42
         */
43
        window.$date = function(value, options) {
43
        window.$date = function(value, options) {
44
            if(!value) return '';
44
            if(!value) return '';
45
            var tz = (options&&options.tz)||def_tz;
45
            let tz = (options&&options.tz)||def_tz;
46
            let no_tz_adjust = (options&&options.no_tz_adjust)||false;
46
            var m = dayjs(value);
47
            var m = dayjs(value);
47
            if ( ! value.match(/^\d{4}-\d{2}-\d{2}$/ ) ) {
48
            if ( !no_tz_adjust && ! value.match(/^\d{4}-\d{2}-\d{2}$/ ) ) {
48
                m = m.tz(tz);
49
                m = m.tz(tz);
49
            }
50
            }
50
51
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (+1 lines)
Lines 870-875 Link Here
870
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
870
    [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
871
    [% PROCESS 'modal-claims.inc' %]
871
    [% PROCESS 'modal-claims.inc' %]
872
    [% PROCESS 'modal-claims-js' %]
872
    [% PROCESS 'modal-claims-js' %]
873
    [% INCLUDE 'js-date-format.inc' %]
873
874
874
    <script>
875
    <script>
875
        /* Set some variable needed in circulation.js */
876
        /* Set some variable needed in circulation.js */
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (-8 / +9 lines)
Lines 308-317 $(document).ready(function() { Link Here
308
                {
308
                {
309
                    "iDataSort": 2, // Sort on hidden unformatted date due column
309
                    "iDataSort": 2, // Sort on hidden unformatted date due column
310
                    "mDataProp": function( oObj ) {
310
                    "mDataProp": function( oObj ) {
311
                        var due = oObj.date_due_formatted;
311
                        let date_due_formatted = $datetime(oObj.date_due, { as_due_date: true, no_tz_adjust: true });
312
                        if ( oObj.date_due_overdue ) {
312
                        var due = oObj.date_due_overdue
313
                            due = "<span class='overdue'>" + due + "</span>";
313
                            ? "<span class='overdue'>" + date_due_formatted + "</span>"
314
                        }
314
                            : date_due_formatted;
315
315
316
                        due = "<span id='date_due_" + oObj.itemnumber + "' class='date_due'>" + due + "</span>";
316
                        due = "<span id='date_due_" + oObj.itemnumber + "' class='date_due'>" + due + "</span>";
317
317
Lines 426-432 $(document).ready(function() { Link Here
426
                },
426
                },
427
                {
427
                {
428
                    "iDataSort": 10, // Sort on hidden unformatted issuedate column
428
                    "iDataSort": 10, // Sort on hidden unformatted issuedate column
429
                    "mDataProp": "issuedate_formatted",
429
                    "mDataProp": "issuedate",
430
                },
430
                },
431
                {
431
                {
432
                    "mDataProp": function ( oObj ) {
432
                    "mDataProp": function ( oObj ) {
Lines 729-738 $(document).ready(function() { Link Here
729
                        "mDataProp": function( oObj ) {
729
                        "mDataProp": function( oObj ) {
730
                            var today = new Date();
730
                            var today = new Date();
731
                            var due = new Date( oObj.date_due );
731
                            var due = new Date( oObj.date_due );
732
                            let date_due_formatted = $datetime(oObj.date_due, { as_due_date: true, no_tz_adjust: true });
732
                            if ( today > due ) {
733
                            if ( today > due ) {
733
                                return "<span class='overdue'>" + oObj.date_due_formatted + "</span>";
734
                                return "<span class='overdue'>" + date_due_formatted + "</span>";
734
                            } else {
735
                            } else {
735
                                return oObj.date_due_formatted;
736
                                return date_due_formatted;
736
                            }
737
                            }
737
                        }
738
                        }
738
                    },
739
                    },
Lines 822-828 $(document).ready(function() { Link Here
822
                    },
823
                    },
823
                    {
824
                    {
824
                        "iDataSort": 7, // Sort on hidden unformatted issuedate column
825
                        "iDataSort": 7, // Sort on hidden unformatted issuedate column
825
                        "mDataProp": "issuedate_formatted",
826
                        "mDataProp": "issuedate",
826
                    },
827
                    },
827
                    {
828
                    {
828
                        "mDataProp": function ( oObj ) {
829
                        "mDataProp": function ( oObj ) {
(-)a/svc/checkouts (-13 lines)
Lines 288-305 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
288
        return_claim_created_on_formatted => $c->{return_claim_created_on} ? output_pref({ dt => dt_from_string( $c->{return_claim_created_on} ) }) : undef,
288
        return_claim_created_on_formatted => $c->{return_claim_created_on} ? output_pref({ dt => dt_from_string( $c->{return_claim_created_on} ) }) : undef,
289
        return_claim_updated_on_formatted => $c->{return_claim_updated_on} ? output_pref({ dt => dt_from_string( $c->{return_claim_updated_on} ) }) : undef,
289
        return_claim_updated_on_formatted => $c->{return_claim_updated_on} ? output_pref({ dt => dt_from_string( $c->{return_claim_updated_on} ) }) : undef,
290
290
291
        issuedate_formatted => output_pref(
292
            {
293
                dt          => dt_from_string( $c->{issuedate} ),
294
                as_due_date => 1
295
            }
296
        ),
297
        date_due_formatted => output_pref(
298
            {
299
                dt          => dt_from_string( $c->{date_due} ),
300
                as_due_date => 1
301
            }
302
        ),
303
        lost    => $lost,
291
        lost    => $lost,
304
        claims_returned => $claims_returned,
292
        claims_returned => $claims_returned,
305
        damaged => $damaged,
293
        damaged => $damaged,
306
- 

Return to bug 33804