Skip to content

Commit

Permalink
apps/events: fix broken flatpickr initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
goapunk authored and hom3mad3 committed Jun 24, 2024
1 parent ebc51b7 commit 163ba2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ tempelhof/static/fonts
tempelhof/static/images/Roboto*
media/
venv/
static/
./static/
.idea/
9 changes: 4 additions & 5 deletions apps/events/static/events/calendar.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
/* global eventsData */
const Flatpickr = require('flatpickr')
const FlatpickrLocale = require('flatpickr/dist/l10n/de.js')
const $ = require('jquery')
import flatpickr from "flatpickr";
import { German } from "flatpickr/dist/l10n/de.js"

const calendar = document.getElementById('calendar')

if (calendar) {
const $events = $('.calendar-list__item')
const selectorPattern = '[data-date^="{}"]'

let calendarFlatpickr = new Flatpickr(calendar, {
let calendarFlatpickr = flatpickr(calendar, {
inline: true,
locale: FlatpickrLocale[$('html').attr('lang')],
locale: German,
enable: [
date => {
return eventsData.some(eventObj => {
Expand Down
3 changes: 3 additions & 0 deletions changelog/0003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- fix calendar not shown because Flatpickr constructor changed

0 comments on commit 163ba2d

Please sign in to comment.