Grappelli默認datepicker
週日作爲一週的第一天。這真的很刺激!我希望星期一成爲我所有現在和未來模型的第一天。Grappelli中的datepicker中的周開始管理界面
有沒有辦法做到這一點?
到目前爲止,我發現唯一的「solution」涉及改變模型的媒體類。然而,這種解決方案似乎不工作,因爲與以下:
class Monkey(ImportExportActionModelAdmin):
class Media:
js = ("static/i18n/ui.datepicker-en-GB.js")
...
哪裏static/i18n/ui.datepicker-en-GB.js
是
(function($) {
// datepicker, timepicker init
grappelli.initDateAndTimePicker = function() {
var options = {
closeText: "Done",
prevText: "Prev",
nextText: "Next",
currentText: "Today",
monthNames: [ "January","February","March","April","May","June",
"July","August","September","October","November","December" ],
monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ],
dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
dayNamesMin: [ "Su","Mo","Tu","We","Th","Fr","Sa" ],
weekHeader: "Wk",
dateFormat: "dd/mm/yy",
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ""
};
})(grp.jQuery);
在任何情況下,這種解決方案是次優的使用會日期的任何新模式必須定義相同的Meta類。