shortcut-buttons-flatpickr icon indicating copy to clipboard operation
shortcut-buttons-flatpickr copied to clipboard

Update CDN link in the readme to latest version

Open nsmeele opened this issue 2 years ago • 1 comments

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?

nsmeele avatar May 18 '22 11:05 nsmeele

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>

arthursioux avatar Mar 11 '24 22:03 arthursioux