作为参考,这是使用 rails admin datepicker 的工作输入的工作自定义操作视图的外观
:javascript
jQuery(function($) {
$.filters.options.regional = {
datePicker: {
dateFormat: "mm/dd/yy",
dayNames: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
dayNamesShort: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
dayNamesMin: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
firstDay: "1",
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"]
}
}
});
:javascript
$(function() {
$('.date').datepicker($.filters.options.regional);
});
%form.pjax-form.form-inline{"accept-charset" => "UTF-8", :method => "get"}
%div{:style => "display:none"}
%input{:name => "utf8", :type => "hidden", :value => "✓"}/
.well
%span#filters_box
%p.filter.form-search
%span.label.label-info.form-label
Created at
%select.switch-additionnal-fieldsets.input-small{:name => "created_at"}
%option{"data-additional-fieldset" => "default", :value => "default"} Date ...
%option{"data-additional-fieldset" => "between", :value => "between"} Between ... and ...
%option{:value => "today"} Today
%option{:value => "yesterday"} Yesterday
%option{:value => "this_week"} This week
%option{:value => "last_week"} Last week
%option{:disabled => "disabled"} ---------
%option{:value => "_not_null"} Is present
%option{:value => "_null"} Is blank
%input.date.additional-fieldset.default.input-small{:name => "created_at", :style => "display:inline-block;", :type => "text", :value => ""}/
%input.date.additional-fieldset.between.input-small{:name => "start_date", :placeholder => "-∞", :style => "display:none;", :type => "text", :value => ""}/
%input.date.additional-fieldset.between.input-small{:name => "end_date", :placeholder => "∞", :style => "display:none;", :type => "text", :value => ""}/
%button.btn.btn-primary{"data-disable-with" => "<i class='icon-white icon-refresh'></i> Refresh", :type => "submit"}
%i.icon-white.icon-refresh
Refresh
如您所见,我必须添加区域内容并自己调用日期选择器。