我怎样才能更改我的日期范围选择器第一次显示月份
how can i change my date range picker first time showing month
我正在使用日期范围选择器作为过滤器选项。在默认日期选择器中显示当前月份和下个月。但我需要上个月和当前月份。我该怎么做?
$('#Date').daterangepicker();
<!-- Include Required Prerequisites -->
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap/3/css/bootstrap.css" />
<!-- Include Date Range Picker -->
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css" />
<div id="Date" class="col-xs-5 col-md-4 paddingNull filterImageAlign" >here select</div>
只需将此添加到您的 js 代码中:
$('#Date').daterangepicker({
"startDate": "-1m",
"endDate": '+1m'
)};
我正在使用日期范围选择器作为过滤器选项。在默认日期选择器中显示当前月份和下个月。但我需要上个月和当前月份。我该怎么做?
$('#Date').daterangepicker();
<!-- Include Required Prerequisites -->
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap/3/css/bootstrap.css" />
<!-- Include Date Range Picker -->
<script type="text/javascript" src="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/bootstrap.daterangepicker/2/daterangepicker.css" />
<div id="Date" class="col-xs-5 col-md-4 paddingNull filterImageAlign" >here select</div>
只需将此添加到您的 js 代码中:
$('#Date').daterangepicker({
"startDate": "-1m",
"endDate": '+1m'
)};