How to use the flatpickr/dist/l10n/de.de 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 Radiergummi / kiosk / resources / assets / js / legacy / src / edit.js View on Github external
paste:               {
      forcePlainText:    true,
      cleanPastedHTML:   true,
      cleanReplacements: [],
      cleanAttrs:        [ 'class', 'style', 'dir', 'id' ],
      cleanTags:         [ 'meta', 'script' ],
      unwrapTags:        []
    }
  });

  /**
   * set up the date picker for the publication date
   */
  const dateInput  = document.querySelector('#book-publishing-date'),
        datePicker = new Flatpickr(dateInput, {
          locale:      FlatpickrLocale.de,
          defaultDate: new Date(dateInput.dataset.date),
          dateFormat:  'd.m.Y',
          appendTo:    dateInput.parentNode,
          static:      true
        });

  document.querySelector('input#book-cover').addEventListener('change', function(event) {
    if (this.files && this.files[ 0 ]) {
      const reader = new FileReader();

      reader.onload = event => {
        let coverPlaceholder = document.querySelector('.book-cover-placeholder');
        coverPlaceholder.classList.add('loaded');
        coverPlaceholder.style.backgroundImage = `url(data:${event.target.result})`;
      };