From: erickson Date: Fri, 2 Feb 2007 20:15:21 +0000 (+0000) Subject: added new iso-compliant date lib. using new date lib to proplery parse and handle... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6b9d210eab984dcaf63fd8b15b874fc6ffd26fbf;p=Evergreen.git added new iso-compliant date lib. using new date lib to proplery parse and handle dates. added warning message to alert a patron if their account has expired git-svn-id: svn://svn.open-ils.org/ILS/trunk@6852 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/opac/skin/default/js/myopac.js b/Open-ILS/web/opac/skin/default/js/myopac.js index a881a5d923..fc7ea13ef9 100644 --- a/Open-ILS/web/opac/skin/default/js/myopac.js +++ b/Open-ILS/web/opac/skin/default/js/myopac.js @@ -505,10 +505,17 @@ function _finesFormatNumber(num) { //function _trimTime(time) { if(!time) return ""; return time.replace(/\ .*/,""); } function _trimTime(time) { if(!time) return ""; - return time.replace(/T.*/,""); + var d = Date.parseIso8601(time); + if(!d) return ""; /* date parse failed */ + return d.iso8601Format('YMD'); } -function _trimSeconds(time) { if(!time) return ""; return time.replace(/:\d\d\..*$/,""); } +function _trimSeconds(time) { + if(!time) return ""; + var d = Date.parseIso8601(time); + if(!d) return ""; /* date parse failed */ + return d.iso8601Format('YMDHM',null,true,true); +} function myOPACShowTransactions(r) { @@ -741,6 +748,12 @@ function _myOPACSummaryShowUer(r) { fleshedUser = user; if(!user) return; + var expireDate = Date.parseIso8601(user.expire_date()); + if( expireDate < new Date() ) { + appendClear($('myopac.expired.date'), expireDate.iso8601Format('YMD')); + unHideMe($('myopac.expired.alert')); + } + var iv1 = user.ident_value()+''; if (iv1.length > 4) iv1 = iv1.replace(new RegExp(iv1.substring(0,iv1.length - 4)), '***********'); @@ -1151,18 +1164,9 @@ function myOPACDrawNonCatCirc(r) { duration = parseInt(duration + '000'); var dtf = circ.circ_time(); - - /*Date.W3CDTF is not happy with the milliseonds, nor is it - happy without minute component of the timezone */ - dtf = dtf.replace(/\.\d+/,''); - dtf += ":00"; - - var start = new Date.W3CDTF(); - start.setW3CDTF(dtf); + var start = Date.parseIso8601(circ.circ_time()); var due = new Date( start.getTime() + duration ); - due = (due+'').replace(/(.*?:\d\d):.*/, '$1'); - - appendClear($n(row, 'circ_time'), text(due)); + appendClear($n(row, 'circ_time'), text(due.iso8601Format('YMDHM', null, true, true))); } diff --git a/Open-ILS/web/opac/skin/default/js/rdetail.js b/Open-ILS/web/opac/skin/default/js/rdetail.js index 2d44afa04c..57b774b488 100644 --- a/Open-ILS/web/opac/skin/default/js/rdetail.js +++ b/Open-ILS/web/opac/skin/default/js/rdetail.js @@ -145,8 +145,6 @@ function rdetailViewMarc(r,id) { hideMe($('rdetail_extras_loading')); $('rdetail_view_marc_box').innerHTML = r.getResultObject(); - var d = new Date(); - var div = elem('div', { "class" : 'hide_me' }); var span = div.appendChild( elem('abbr') ); diff --git a/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml b/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml index 6d2dc02b7d..ce95d24949 100644 --- a/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml +++ b/Open-ILS/web/opac/skin/default/xml/myopac/myopac_checked.xml @@ -1,7 +1,9 @@
- +
Loading...