diff --git a/source/Ox.UI/js/Calendar/Ox.Calendar.js b/source/Ox.UI/js/Calendar/Ox.Calendar.js
index ffa60f17..106e7a3f 100644
--- a/source/Ox.UI/js/Calendar/Ox.Calendar.js
+++ b/source/Ox.UI/js/Calendar/Ox.Calendar.js
@@ -701,7 +701,7 @@ Ox.Calendar = function(options, self) {
title = '' + event.name + '
' +
event.rangeText + '
' + event.durationText;
} else {
- title = Ox.formatDate(getMouseDate(e), '%a, %b %e, %Y, %H:%M:%S', true);
+ title = Ox.formatDate(getMouseDate(e), '%a, %b %e, %x, %H:%M:%S', true);
}
self.$tooltip.options({
title: title
diff --git a/source/Ox.js b/source/Ox.js
index c456275f..07caee9b 100644
--- a/source/Ox.js
+++ b/source/Ox.js
@@ -2114,7 +2114,7 @@ Ox.formatDate Formats a date according to a format string
See
strftime
and ISO 8601.
- '%Q' (quarter) and '%X' (year with 'BC'/'AD') are non-standard
+ '%Q' (quarter) and '%X'/'%x' (year with 'BC'/'AD') are non-standard
@@ -2190,6 +2190,8 @@ Ox.formatDate Formats a date according to a format string
'0'
> Ox.formatDate(Ox.test.date, '%X') // Full year with BC or AD
'2005 AD'
+ > Ox.formatDate(Ox.test.date, '%x') // Full year with BC or AD if year < 1000
+ '2005'
> Ox.formatDate(Ox.test.date, '%Y') // Full year
'2005'
> Ox.formatDate(Ox.test.date, '%y') // Abbreviated year
@@ -2247,8 +2249,12 @@ Ox.formatDate = function(date, str, utc) {
}],
['w', function(d) {return Ox.getDay(d, utc);}],
['X', function(d) {
- var y = Ox.getFullYear(d, utc);
- return Math.abs(y) + ' ' + Ox.BCAD[y < 0 ? 0 : 1];
+ var y = Ox.getFullYear(d, utc);
+ return Math.abs(y) + ' ' + Ox.BCAD[y < 0 ? 0 : 1];
+ }],
+ ['x', function(d) {
+ var y = Ox.getFullYear(d, utc);
+ return Math.abs(y) + (y < 1000 ? ' ' + Ox.BCAD[y < 0 ? 0 : 1] : '');
}],
['Y', function(d) {return Ox.getFullYear(d, utc);}],
['y', function(d) {return Ox.getFullYear(d, utc).toString().substr(-2);}],