mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25856 -- Added %B support to Date.strftime.
This enables the admin to display the correct localized month name if %B is used in the date format.
This commit is contained in:
@@ -204,4 +204,5 @@ depends on core.js for utility functions like removeChildren or quickElement
|
||||
}
|
||||
};
|
||||
window.Calendar = Calendar;
|
||||
window.CalendarNamespace = CalendarNamespace;
|
||||
})();
|
||||
|
||||
@@ -153,8 +153,15 @@ function findPosY(obj) {
|
||||
return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond();
|
||||
};
|
||||
|
||||
Date.prototype.getFullMonthName = function() {
|
||||
return typeof window.CalendarNamespace === "undefined"
|
||||
? this.getTwoDigitMonth()
|
||||
: window.CalendarNamespace.monthsOfYear[this.getMonth()];
|
||||
};
|
||||
|
||||
Date.prototype.strftime = function(format) {
|
||||
var fields = {
|
||||
B: this.getFullMonthName(),
|
||||
c: this.toString(),
|
||||
d: this.getTwoDigitDate(),
|
||||
H: this.getTwoDigitHour(),
|
||||
|
||||
Reference in New Issue
Block a user