如何从onChange中的selectedDates中获取日期对象,并从中提取月和日,并将它们放在我需要的位置(在另一个单独的div中,使用我的样式)
<div>
<p>CHECK IN</p>
<input id="" class="datepicker-from" placeholder=" ">
</div>
$(document).ready(function() {
$('.datepicker-from').flatpickr({
plugins: [new rangePlugin({
input: '.datepicker-to'
})],
altInput: true,
altFormat: "M j",
dateFormat: "m-d",
position: "below",
defaultDate: new Date(),
minDate: "today",
maxDate: new Date().fp_incr(210) // 14 days from now
});
});