Index: branches/RC/core/admin_templates/js/calendar/calendar.js =================================================================== diff -u -N -r8929 -r11528 --- branches/RC/core/admin_templates/js/calendar/calendar.js (.../calendar.js) (revision 8929) +++ branches/RC/core/admin_templates/js/calendar/calendar.js (.../calendar.js) (revision 11528) @@ -12,7 +12,7 @@ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html */ -// $Id: calendar.js,v 1.2 2007-01-18 09:02:27 kostja Exp $ +// $Id: calendar.js,v 1.2.2.1 2009-03-26 22:02:16 alex Exp $ /** The Calendar object constructor. */ Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { @@ -1571,34 +1571,55 @@ }; -Calendar.phpDateFormat = function(php_format) -{ - originals = [ 'm', // Numeric representation of a month, with leading zeros - 'n', // Numeric representation of a month, without leading zeros - 'd', // Day of the month, 2 digits with leading zeros - 'j', // Day of the month without leading zeros - 'y', // A two digit representation of a year - 'Y', // A full numeric representation of a year, 4 digits - 'h|g', // 12-hour format of an hour with|without leading zeros - 'H|G', // 24-hour format of an hour with|without leading zeros - 'i', // Minutes with leading zeros - 's', // Seconds, with leading zeros - 'a|A' // Lowercase|Uppercase Ante meridiem and Post meridiem - ] - replacements =[ '%m', - '%m', - '%d', - '%e', - '%y', - '%Y', - '%l', - '%k', - '%M', - '%S', - '%P'] +Calendar.phpDateFormat = function(php_format) { + originals = [ + // date + 'm', // Numeric representation of a month, with leading zeros + 'n', // Numeric representation of a month, without leading zeros + 'd', // Day of the month, 2 digits with leading zeros + 'j', // Day of the month without leading zeros + 'y', // A two digit representation of a year + 'Y', // A full numeric representation of a year, 4 digits + + // time (hours) + 'h', // 12-hour format of an hour with leading zeros + 'g', // 12-hour format of an hour without leading zeros + 'H', // 24-hour format of an hour with leading zeros + 'G', // 24-hour format of an hour without leading zeros + + // time (minutes, seconds, am/pm) + 'i', // Minutes with leading zeros + 's', // Seconds, with leading zeros + 'a', // Lowercase Ante meridiem and Post meridiem + 'A' // Uppercase Ante meridiem and Post meridiem + ]; + + replacements = [ + // date + '%m', + '%m' /* '%n' is new line format, so use month with leading zeros here too */, + '%d', + '%e', + '%y', + '%Y', + + // time (hours) + '%I', + '%l', + '%H', + '%k', + + // time (minutes, seconds, am/pm) + '%M', + '%S', + '%P', + '%p' + ]; + for (var i in originals) { php_format = php_format.replace(new RegExp(originals[i]), replacements[i]); } + return php_format; }