Wie kann ich $ ('. Selector'). Flatpickr nicht eine Funktion?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie kann ich $ ('. Selector'). Flatpickr nicht eine Funktion?

by Anonymous » 30 Apr 2025, 21:12

I'm using jquery 3.6 and flatpickr 4.6.9 in my project, but when I try to instantiate using my jquery selector, it gives me the following error:

Uncaught TypeError: $datePlanted.flatpickr is not a function

JQuery

Code: Select all

import $ from 'jquery';
import flatpickr from 'flatpickr';

const $datePlanted = $('.plot-tree-form__date-planted-text')
$datePlanted.flatpickr({
enableTime: false,
dateFormat: 'Y-m-d'
});
< /code>
html < /p>


Date Planted Here



Laut Flatpickr -Dokumentation sollte dies funktionieren.
Wie kann ich dieses Problem lösen?

Top