How to use the flatpickr.defaultConfig function in flatpickr

To help you get started, we’ve selected a few flatpickr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ankurk91 / vue-flatpickr-component / src / component.js View on Github external
this.events.forEach((hook) => {
      // Respect global callbacks registered via setDefault() method
      let globalCallbacks = Flatpickr.defaultConfig[hook] || [];

      // Inject our own method along with user callback
      let localCallback = (...args) => {
        this.$emit(camelToKebab(hook), ...args)
      };

      // Overwrite with merged array
      safeConfig[hook] = arrayify(safeConfig[hook] || []).concat(globalCallbacks, localCallback);
    });
github Enalean / tuleap / src / www / themes / common / tlp / src / vendor-overrides / flatpickr.js View on Github external
* the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see .
 */

import flatpickr from "flatpickr";

flatpickr.defaultConfig.prevArrow = "<i class="fa fa-angle-left"></i>";
flatpickr.defaultConfig.nextArrow = "<i class="fa fa-angle-right"></i>";
flatpickr.l10ns.default.firstDayOfWeek = 1;

export default datePicker;

function datePicker(element, options) {
    if (isNaN(Date.parse(element.value))) {
        element.value = null;
    }
    options = options || {};

    options.weekNumbers = true;
    options.dateFormat = "Y-m-d";
    options.time_24hr = true;
    options.monthSelectorType = "static";

    let placeholder = "yyyy-mm-dd";
github Enalean / tuleap / src / www / themes / common / tlp / src / vendor-overrides / flatpickr.js View on Github external
* it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see .
 */

import flatpickr from "flatpickr";

flatpickr.defaultConfig.prevArrow = "<i class="fa fa-angle-left"></i>";
flatpickr.defaultConfig.nextArrow = "<i class="fa fa-angle-right"></i>";
flatpickr.l10ns.default.firstDayOfWeek = 1;

export default datePicker;

function datePicker(element, options) {
    if (isNaN(Date.parse(element.value))) {
        element.value = null;
    }
    options = options || {};

    options.weekNumbers = true;
    options.dateFormat = "Y-m-d";
    options.time_24hr = true;
    options.monthSelectorType = "static";
github Enalean / tuleap / src / themes / tlp / src / vendor-overrides / flatpickr.ts View on Github external
* it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see .
 */

import flatpickr from "flatpickr";

flatpickr.defaultConfig.prevArrow = "<i class="fa fa-angle-left"></i>";
flatpickr.defaultConfig.nextArrow = "<i class="fa fa-angle-right"></i>";
flatpickr.l10ns.default.firstDayOfWeek = 1;

export function datePicker(
    element: HTMLInputElement,
    options?: flatpickr.Options.Options
): flatpickr.Instance {
    if (isNaN(Date.parse(element.value))) {
        element.value = "";
    }
    options = options || {};

    options.weekNumbers = true;
    options.dateFormat = "Y-m-d";
    options.time_24hr = true;
    options.monthSelectorType = "static";
github Enalean / tuleap / src / themes / tlp / src / vendor-overrides / flatpickr.ts View on Github external
* the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap. If not, see .
 */

import flatpickr from "flatpickr";

flatpickr.defaultConfig.prevArrow = "<i class="fa fa-angle-left"></i>";
flatpickr.defaultConfig.nextArrow = "<i class="fa fa-angle-right"></i>";
flatpickr.l10ns.default.firstDayOfWeek = 1;

export function datePicker(
    element: HTMLInputElement,
    options?: flatpickr.Options.Options
): flatpickr.Instance {
    if (isNaN(Date.parse(element.value))) {
        element.value = "";
    }
    options = options || {};

    options.weekNumbers = true;
    options.dateFormat = "Y-m-d";
    options.time_24hr = true;
    options.monthSelectorType = "static";