From bf01845602c192f32d5b1f3a6d13f629b1d36dc6 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Wed, 29 Feb 2012 11:09:34 -0500 Subject: [PATCH] Add print_custom.js for tadlSlipDate We use tadlSlipDate on hold slips. This replaces that element with a formatted date 7 days in the future. Originally from https://gist.github.com/179cd9a682a509537cb8 Signed-off-by: Jeff Godin --- .../staff_client/chrome/content/util/print_custom.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Open-ILS/xul/staff_client/chrome/content/util/print_custom.js diff --git a/Open-ILS/xul/staff_client/chrome/content/util/print_custom.js b/Open-ILS/xul/staff_client/chrome/content/util/print_custom.js new file mode 100644 index 0000000000..f59ec8261a --- /dev/null +++ b/Open-ILS/xul/staff_client/chrome/content/util/print_custom.js @@ -0,0 +1,17 @@ +function print_custom(type) { + var type; // we don't care about type + + var elements = document.getElementsByClassName("rcpt"); + var i; + + for (i = 0; i < elements.length; i++) { + e = elements[i]; + if (e.className.match(/tadlSlipDate/gi)) { + var pullDate = new Date(); + pullDate.setDate(pullDate.getDate() + 7); + var writeString = parseInt(pullDate.getMonth()+1) + '/' + pullDate.getDate(); + e.innerHTML = writeString; + } + } + +} -- 2.11.0