我的日期选择器无法正常工作。这是我的密码
用于签入和签出的Javascript代码
$(function(){
$('.checkin').datepicker({
calendarWeeks: true,
todayHighlight: true,
autoclose: true
});
});
$(function(){
$('.checkout').datepicker({
calendarWeeks: true,
todayHighlight: true,
autoclose: true
});
});
HTML代码
<div class="checkin">
<label for="checkin">Check-In:</label> <span class='errors'>{{ $errors->first('checkin') }} </span>
<input type="text" name="checkin" placeholder="Select date*" data-date-format="dd/mm/yyyy" value="
{{old('checkin') }}">
</div>
<div class="checkin">
<label for="checkout">Check-Out:</label> <span class='errors'>{{ $errors->first('checkout') }}
</span>
<span class='errors'>{{ $errors->first('checkout') }} </span>
<input type="text" name="checkout" placeholder="Select date*" data-date-format="dd/mm/yyyy" value="
{{old('checkout') }}">
</div>
在标题中,我具有指向CSS的链接
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-
datepicker/1.5.0/css/bootstrap-datepicker3.min.css">
在body close标签之前,我已将链接放置到我的JS文件中(我正在使用Laravel)
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-
datepicker/1.5.0/css/bootstrap-datepicker3.min.css">