Open nsmeele opened 2 years ago
Here's and example of how to use the class, for novices like me. It taked a while too.
<script type="text/javascript">
flatpickr.setDefaults({
plugins: [
ShortcutButtonsPlugin({
theme: 'dark',
button: [
{
label: "Aceptar",
attributes: {
class: "btn btn-sm rounded-pill btn-light waves-effect",
}
},
{
label: "Cancelar",
attributes: {
class: "btn btn-sm rounded-pill btn-light waves-effect",
}
},
{
label: "Hoy",
attributes: {
class: "btn btn-sm rounded-pill btn-light waves-effect",
}
}
],
//label: "or",
onClick: (index, fp) => {
switch (index) {
case 0:
fp.close();
break;
case 1:
fp.close();
break;
case 2:
fp.close();
fp.setDate(new Date());
break;
}
}
})
]
});
</script>
Hi!
It took me longer than I'm proud of to figure out why button.attributes.class wasn't working. Then I realized, the JS that I downloaded from the CDN link, was still old an old version. :)
So just a little heads-up, maybe update these links?