Stimulus - flatpickr
Hi all i've been trying to do one thing without sucess for few days...
i want to select a date on the flatpickr and then based on that date create a table
Date selected Date selected -1day Date selected -2day Date selected -3day Date selected -4day
//controller_calendar.js
import "flatpickr/dist/themes/dark.css";
export default class extends Flatpickr {
static targets = [ "output" ] <-- want to export the selected date on the flatpickr to the view
change(selectedDates, dateStr,instance) {
console.log (dateStr) <-- this prints out the date i select on the console.
this.outputTarget.textContent = dateStr <-- this should send the dateStr to the outputTarget but doesn't work neither here or on the XX
}
XX <-- if i put it here " this.outputTarget.textContent = dateStr" dateStr doesn't have content.
}
Any idea?
thanks all!