Bug 24765: Updated on date in Claims returned starts off as 12/31/1969
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 2 Mar 2020 14:36:47 +0000 (09:36 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 27 Mar 2020 11:50:16 +0000 (11:50 +0000)
When an item is claimed returned by staff, there is a column called Updated On - this date field column should remain blank until this claimed returned has been updated.  Currently, when an item has been claimed returned, the date in the updated column states 12/31/1969. This date only shows up in the display, it is doesn't show up in the database like this.

Test Plan:
1) Enable return claims
2) Make a claim
3) Note the 'updated on' column has the date 1969-12-31
4) Apply this patch
5) Reload the page ( you may need to clear your browser cache )
6) Note the field is now blank

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

koha-tmpl/intranet-tmpl/prog/js/checkouts.js

index 3900a15..e18c2a2 100644 (file)
@@ -928,8 +928,12 @@ $(document).ready(function() {
                     },
                     {
                         "mDataProp": function ( oObj ) {
-                            let updated_on = new Date( oObj.updated_on );
-                            return updated_on.toLocaleDateString();
+                            if ( oObj.updated_on ) {
+                                let updated_on = new Date( oObj.updated_on );
+                                return updated_on.toLocaleDateString();
+                            } else {
+                                return "";
+                            }
                         }
                     },
                     {