Buttons
You can add buttons to the date picker by setting the buttons
option. For more information, see the buttons section.
Pre defined buttons
new SnowDatePicker('#element', { buttons: ['today', 'clear'] });
Custom buttons
You can add custom buttons by passing an object.
new SnowDatePicker('#element', {
buttons: [
{
innerHTML: 'First Day',
onClick: (event, datepicker) => {
datepicker.setSelectedDate(
new Date((datepicker.currentDate || new Date()).getFullYear(), 0, 1)
);
},
},
'clear',
],
});