From c6393ba1179df5ed65104d749019a2940874d7b6 Mon Sep 17 00:00:00 2001 From: dbs Date: Fri, 5 Mar 2010 19:20:10 +0000 Subject: [PATCH] Ensure that incoming ISO8601 dates comply with Dojo's limited ISO8601 compliance in "My Account" git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_0@15718 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/skin/default/js/myopac.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Open-ILS/web/opac/skin/default/js/myopac.js b/Open-ILS/web/opac/skin/default/js/myopac.js index a01334a2ea..482af9b404 100644 --- a/Open-ILS/web/opac/skin/default/js/myopac.js +++ b/Open-ILS/web/opac/skin/default/js/myopac.js @@ -246,7 +246,7 @@ function myOPACDrawCheckedItem(circ, tbody) { //rnlink.setAttribute('href', 'javascript:myOPACRenewCirc("'+circ.id()+'");'); circsCache.push(circ); - if( circ.renewal_remaining() < 1 ) { + if( circ.renewal_remaining() < 1 ) { $n(row, 'selectme').disabled = true; if(!__can_renew_one) $('mo_renew_button').disabled = true; @@ -395,7 +395,7 @@ function myOPACDrawHolds(r) { var exp_date; if(h.expire_time()) { - exp_date = dojo.date.stamp.fromISOString(h.expire_time()); + exp_date = dojo.date.stamp.fromISOString(h.expire_time().replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3")); $n(row, 'myopac_hold_expire_time').appendChild( text(dojo.date.locale.format(exp_date, {selector:'date'}))); } @@ -585,6 +585,7 @@ function _finesFormatNumber(num) { //function _trimTime(time) { if(!time) return ""; return time.replace(/\ .*/,""); } function _trimTime(time) { if(!time) return ""; + time = time.replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3"); var d = dojo.date.stamp.fromISOString(time); if(!d) return ""; /* date parse failed */ return d.iso8601Format('YMD'); @@ -592,7 +593,7 @@ function _trimTime(time) { function _trimSeconds(time) { if(!time) return ""; - var d = dojo.date.stamp.fromISOString(time); + var d = dojo.date.stamp.fromISOString(time.replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3")); if(!d) return ""; /* date parse failed */ return d.iso8601Format('YMDHM',null,true,true); } @@ -690,8 +691,7 @@ function myOPACShowCircTransaction(trans, record, circ) { $n(row,'myopac_circ_trans_start'). appendChild(text(_trimTime(trans.xact_start()))); - - var due = _trimTime(circ.due_date()); + var due = _trimTime(circ.due_date()); var checkin = _trimTime(circ.stop_fines_time()); $n(row,'myopac_circ_trans_due').appendChild(text(due)) @@ -1372,7 +1372,7 @@ function myOPACDrawNonCatCirc(r) { duration = parseInt(duration + '000'); var dtf = circ.circ_time(); - var start = dojo.date.stamp.fromISOString(circ.circ_time()); + var start = dojo.date.stamp.fromISOString(circ.circ_time().replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3")); var due = new Date( start.getTime() + duration ); appendClear($n(row, 'circ_time'), text(due.iso8601Format('YMDHM', null, true, true))); } -- 2.11.0