Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CDN link in the readme to latest version #40

Open
nsmeele opened this issue May 18, 2022 · 1 comment
Open

Update CDN link in the readme to latest version #40

nsmeele opened this issue May 18, 2022 · 1 comment

Comments

@nsmeele
Copy link

nsmeele commented May 18, 2022

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?

@arthursioux
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants