From: Kyle Huckins Date: Thu, 28 Feb 2019 18:52:34 +0000 (+0000) Subject: CAT-206 Cataloging Date Compare X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b4ed5858daea46d4accd1c97ca9df350e9537cb4;p=working%2FEvergreen.git CAT-206 Cataloging Date Compare - Compare selected and existing cataloging dates to toggle availability of Update and Clear date buttons. Signed-off-by: Kyle Huckins Changes to be committed: modified: Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 modified: Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js --- diff --git a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 index 5ec1415c77..7d993234bd 100644 --- a/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 +++ b/Open-ILS/src/templates/staff/cat/share/t_marcedit.tt2 @@ -63,8 +63,12 @@
- - + +
diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js index 83c1e37177..45ca9ed7a5 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js +++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js @@ -1260,6 +1260,13 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap']) return true; }; + $scope.checkDate = function(cataloging_date) { + if (!cataloging_date || !$scope.Record().cataloging_date()) return cataloging_date == $scope.Record().cataloging_date(); + var ogCatDate = new Date($scope.Record().cataloging_date()).toISOString().split("T")[0]; + var compCatalogingDate = new Date(cataloging_date).toISOString().split("T")[0]; + return compCatalogingDate == ogCatDate; + } + $scope.updateDate = function(cataloging_date) { if (cataloging_date != $scope.Record().cataloging_date()) { if (cataloging_date instanceof Date && !isNaN(cataloging_date)) {