[open-ils-commits] r823 - conifer/branches/rel_1_6_0/web/opac/skin/default/js (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 5 14:45:12 EST 2010
Author: dbs
Date: 2010-03-05 14:45:08 -0500 (Fri, 05 Mar 2010)
New Revision: 823
Modified:
conifer/branches/rel_1_6_0/web/opac/skin/default/js/copy_details.js
conifer/branches/rel_1_6_0/web/opac/skin/default/js/myopac.js
Log:
Fix date displays in My Account and Copy Details
Modified: conifer/branches/rel_1_6_0/web/opac/skin/default/js/copy_details.js
===================================================================
--- conifer/branches/rel_1_6_0/web/opac/skin/default/js/copy_details.js 2010-03-05 02:34:47 UTC (rev 822)
+++ conifer/branches/rel_1_6_0/web/opac/skin/default/js/copy_details.js 2010-03-05 19:45:08 UTC (rev 823)
@@ -256,12 +256,12 @@
if( copy.circulations() ) {
circ = copy.circulations()[0];
if( circ ) {
- var due_time = dojo.date.stamp.fromISOString(circ.due_date());
- if( showDueTime ) {
- $n(row, 'copy_due_date').appendChild(text(dojo.date.locale.format(due_time, {"formatLength": "medium"})));
- } else {
- $n(row, 'copy_due_date').appendChild(text(dojo.date.locale.format(due_time, {"selector": "date", "formatLength": "medium"})));
- }
+ var due_time = dojo.date.stamp.fromISOString(circ.due_date().replace(/(T\d\d:\d\d:\d\d)([+-]\d\d)(\d)/, "$1$2:$3"));
+ if( showDueTime ) {
+ $n(row, 'copy_due_date').appendChild(text(dojo.date.locale.format(due_time, {"formatLength": "medium"})));
+ } else {
+ $n(row, 'copy_due_date').appendChild(text(dojo.date.locale.format(due_time, {"selector": "date", "formatLength": "medium"})));
+ }
}
}
}
Modified: conifer/branches/rel_1_6_0/web/opac/skin/default/js/myopac.js
===================================================================
--- conifer/branches/rel_1_6_0/web/opac/skin/default/js/myopac.js 2010-03-05 02:34:47 UTC (rev 822)
+++ conifer/branches/rel_1_6_0/web/opac/skin/default/js/myopac.js 2010-03-05 19:45:08 UTC (rev 823)
@@ -397,7 +397,7 @@
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'})));
}
@@ -587,6 +587,7 @@
//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');
@@ -594,7 +595,7 @@
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);
}
@@ -692,8 +693,7 @@
$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))
@@ -1374,7 +1374,7 @@
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)));
}
More information about the open-ils-commits
mailing list