How to use the flatpickr.formatDate 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 formio / formio.js / src / widgets / CalendarWidget.js View on Github external
this.settings.formatDate = (date, format) => {
      // Only format this if this is the altFormat and the form is readOnly.
      if (this.settings.readOnly && (format === this.settings.altFormat)) {
        if (this.settings.saveAs === 'text' || this.loadZones()) {
          return Flatpickr.formatDate(date, format);
        }

        return formatOffset(Flatpickr.formatDate.bind(Flatpickr), date, format, this.timezone);
      }

      return Flatpickr.formatDate(date, format);
    };
github TravisL12 / apod_chrome_extension / src / utilities / dateUtility.js View on Github external
export function randomDate() {
  const start = new Date(MIN_APOD_DATE.split("-"));
  const end = new Date();
  const date = new Date(
    start.getTime() + Math.random() * (end.getTime() - start.getTime())
  );

  return flatpickr.formatDate(date, DATE_FORMAT);
}
github TravisL12 / apod_chrome_extension / src / utilities / dateUtility.js View on Github external
export function today() {
  return flatpickr.formatDate(new Date(), DATE_FORMAT);
}
github TravisL12 / apod_chrome_extension / src / utilities / dateUtility.js View on Github external
export function formatDate(date) {
  return flatpickr.formatDate(date, DATE_FORMAT);
}
github netgen-layouts / layouts-core / bundles / LayoutsAdminBundle / Resources / es6 / plugins / datetimepicker.js View on Github external
onChange(date) {
        this.formattedEl.value = date.length ? flatpickr.formatDate(date[0], 'Y-m-dTH:i') : '';
        this.toggleClearBtn();
    }
github TravisL12 / apod_chrome_extension / src / utilities / dateUtility.js View on Github external
export function adjacentDate(dateString, direction) {
  let adjDate = new Date(actualDate(dateString).getTime());

  adjDate = new Date(adjDate.setDate(adjDate.getDate() + direction));
  return flatpickr.formatDate(adjDate, DATE_FORMAT);
}