From 9fa734b1009147fabb6603178c556989637b8bfd Mon Sep 17 00:00:00 2001 From: philipp lang Date: Thu, 3 Oct 2024 13:48:45 +0200 Subject: [PATCH] Lint --- resources/js/app.js | 52 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index 309f8f7..8c9a809 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,39 +1,37 @@ -import "../css/app.css"; -import Alpine from "alpinejs"; -import Datepicker from "flowbite-datepicker/Datepicker"; -import de from "../../node_modules/flowbite-datepicker/js/i18n/locales/de.js"; +import '../css/app.css'; +import Alpine from 'alpinejs'; +import Datepicker from 'flowbite-datepicker/Datepicker'; +import de from '../../node_modules/flowbite-datepicker/js/i18n/locales/de.js'; Datepicker.locales.de = de.de; -import dayjs from "dayjs"; -import customParseFormat from "dayjs/plugin/customParseFormat"; +import dayjs from 'dayjs'; +import customParseFormat from 'dayjs/plugin/customParseFormat'; dayjs.extend(customParseFormat); function initDatepicker(el) { - new Datepicker(el, { - autohide: true, - format: "dd.mm.yyyy", - language: "de", - update: true, - }); - el.addEventListener("changeDate", function (event) { - event.target.dispatchEvent(new Event("input")); - }); + new Datepicker(el, { + autohide: true, + format: 'dd.mm.yyyy', + language: 'de', + update: true, + }); + el.addEventListener('changeDate', function (event) { + event.target.dispatchEvent(new Event('input')); + }); } -document.querySelectorAll("[datepicker]").forEach((el) => initDatepicker(el)); +document.querySelectorAll('[datepicker]').forEach((el) => initDatepicker(el)); window.Alpine = Alpine; -Alpine.data("form", () => ({ - birthday: null, - date: null, - isUnder18: function () { - if (!this.birthday || !this.date) { - return false; - } +Alpine.data('form', () => ({ + birthday: null, + date: null, + isUnder18: function () { + if (!this.birthday || !this.date) { + return false; + } - return dayjs(this.birthday, "DD.MM.YYYY") - .add(18, "year") - .isAfter(dayjs(this.date, "DD.MM.YYYY")); - }, + return dayjs(this.birthday, 'DD.MM.YYYY').add(18, 'year').isAfter(dayjs(this.date, 'DD.MM.YYYY')); + }, })); Alpine.start();