我有一個應用程序,我必須提交月度報告和季度報告。我爲月度報告使用了bootstrap-datepicker,並且我希望在應用程序中保持相同的標準,因此如果我避免使用選擇框來顯示宿舍,那將是非常好的。 這是當你在月視圖模式是什麼引導提供如何更改引導日期選擇器月視圖來顯示宿舍
這就是我想要當它選擇做
,所有3個月季度會被選中。
我檢查了bootstrap-datepicker.js
文件,我只看到表生成代碼爲:
DPGlobal.template = '<div class="datepicker">'+
'<div class="datepicker-days">'+
'<table class=" table-condensed">'+
DPGlobal.headTemplate+
'<tbody></tbody>'+
DPGlobal.footTemplate+
'</table>'+
'</div>'+
'<div class="datepicker-months">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
DPGlobal.footTemplate+
'</table>'+
'</div>'+
'<div class="datepicker-years">'+
'<table class="table-condensed">'+
DPGlobal.headTemplate+
DPGlobal.contTemplate+
DPGlobal.footTemplate+
'</table>'+
'</div>'+
'</div>';
,並在DPGlobal
變量是模板:
headTemplate: '<thead>'+
'<tr>'+
'<th class="prev">«</th>'+
'<th colspan="5" class="datepicker-switch"></th>'+
'<th class="next">»</th>'+
'</tr>'+
'</thead>',
contTemplate: '<tbody><tr><td colspan="9"></td></tr></tbody>',
footTemplate: '<tfoot>'+
'<tr>'+
'<th colspan="7" class="today"></th>'+
'</tr>'+
'<tr>'+
'<th colspan="7" class="clear"></th>'+
'</tr>'+
'</tfoot>'
所有幫助表示讚賞
是不是矯枉過正使用這個插件來選擇宿舍?畢竟一季度只是一年的數字和季度數字。如果是針對季度的本地化月份名稱顯示(如果Q1,Q2,Q3,Q4不夠好),那麼您可以使用moment.js,您可能已經使用了此功能並結合日期範圍 - 選擇器... – Jos