我有一个显示日期选择器的页面,使用 Vanilla JS Datepicker,
如何显示小时和分钟?
const elem = document.querySelector('input[name="foo"]');
const datepicker = new Datepicker(elem, {
// ...options
});
https://raw.githack.com/mymth/vanillajs-datepicker/v1.3.4/demo/index.html
我想这就是你要找的
const elem = document.querySelector('input[name="foo"]');
const datepicker = new Datepicker(elem, {
time: true, // Enable time picker
hours: true, // Display hours
minutes: true, // Display minutes
// Additional options can be added here
});