我在文档中找不到如何仅显示当天的第一个字母。 默认情况下,它显示周一星期二等... 我想像下面的例子一样显示它
https://jsfiddle.net/wdL13cty/8/
window.addEventListener('load',(event) => {
var datesToEnable = JSON.parse(document.getElementById('dates').innerHTML);
console.log(datesToEnable);
var fp = flatpickr(document.querySelector('#flatpickr'),{
// init flatpicker as an inline NON modal date picker
// min date today
// disable all dates
// enable dates coming from JSON object
// able to change the datge format if necessary
inline: 'true',altFormat: "F j,Y",altInput: true,minDate: "today",disableMobile: "true",enable: datesToEnable.dates,onChange: function(selectedDates,dateStr,instance) {
console.log('date: ',dateStr);
}
});
});