How to use

Copy-paste the stylesheet <link> into your <head> to load the CSS.

              
                <link rel="stylesheet" href="../assets/vendor/flatpickr/dist/flatpickr.min.css">
              
            

Copy-paste the following <script> near the end of your pages under JS Implementing Plugins to enable it.

              
                <script src="../assets/vendor/flatpickr/dist/flatpickr.min.js"></script>
              
            

Copy-paste the following <script> near the end of your pages under JS Front to enable it.

              
              
            

Copy-paste the init function under JS Plugins Init., before the closing </body> tag, to enable it.

              
                <script>
                  $(document).on('ready', function () {
                    // initialization of flatpickr
                    $('.js-flatpickr').each(function () {
                      $.HSCore.components.HSFlatpickr.init($(this));
                    });
                  });
                </script>
              
            

Custom file input

With value

Use value attribute.

External elements

Range dates

Use range dates.

Multiple dates

Use multiple mode.

Plain Text

Use "inline": true

Disabling dates

Your can write custom javascript function.

Your can write custom javascript function.

Methods

Parameters Description Default value
mode Mode of flatpickr. single
dateFormat Date format. d M Y
maxDate The maximum date that a user can pick to (inclusive). false
locale.firstDayOfWeek Day number. 1
locale.weekdays.shorthand Short day names. ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
locale.rangeSeparator Range separator in the field. -
nextArrow Next arrow template. <i class="la la-angle-right icon-text icon-text-sm"></i>
prevArrow Previous arrow template. <i class="la la-angle-left icon-text icon-text-sm"></i>