[open-ils-commits] r16315 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Apr 26 16:37:02 EDT 2010
Author: phasefx
Date: 2010-04-26 16:36:57 -0400 (Mon, 26 Apr 2010)
New Revision: 16315
Modified:
trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js
Log:
wire org unit settings for date/time formatting into util.date library
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js 2010-04-26 20:06:40 UTC (rev 16314)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/date.js 2010-04-26 20:36:57 UTC (rev 16315)
@@ -93,10 +93,21 @@
var s = format;
if (s == '') { s = '%F %H:%M'; }
if (typeof window.dojo != 'undefined') {
+ JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve();
dojo.require('dojo.date.locale');
dojo.require('dojo.date.stamp');
- s = s.replace( /%\{localized\}/g, dojo.date.locale.format( _date ) );
- s = s.replace( /%\{localized_date\}/g, dojo.date.locale.format( _date, { 'selector' : 'date' } ) );
+ var dojo_format = {};
+ var dojo_format2 = { 'selector' : 'date' };
+ if (data.hash.aous['format.date']) {
+ dojo_format['datePattern'] = data.hash.aous['format.date'];
+ dojo_format2['datePattern'] = data.hash.aous['format.date'];
+ }
+ if (data.hash.aous['format.time']) {
+ dojo_format['timePattern'] = data.hash.aous['format.time'];
+ dojo_format2['timePattern'] = data.hash.aous['format.time'];
+ }
+ s = s.replace( /%\{localized\}/g, dojo.date.locale.format( _date, dojo_format ) );
+ s = s.replace( /%\{localized_date\}/g, dojo.date.locale.format( _date, dojo_format2 ) );
s = s.replace( /%\{iso8601\}/g, dojo.date.stamp.toISOString( _date ) );
}
s = s.replace( /%m/g, mm );
More information about the open-ils-commits
mailing list