diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml deleted file mode 100644 index 9626ff6..0000000 --- a/.github/workflows/webpack.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: NodeJS with Webpack - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x, 20.x, 22.x] - - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Build - run: | - npm install - npx webpack diff --git a/app.js b/app.js index 01918d8..5c82154 100644 --- a/app.js +++ b/app.js @@ -2,6 +2,11 @@ * Main Application * Manages UI interactions and coordinates between components */ +function monthName(monthNumber) { + return new Intl.DateTimeFormat('de-DE', { month: 'long' }).format(new Date(2000, monthNumber - 1, 1)); +} +const WEEKDAY_NAMES = ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag']; + class DienstplanApp { constructor() { this.storage = new DataStorage(); @@ -134,7 +139,7 @@ class DienstplanApp { document.getElementById('calc-year-select').value = currentYear; // Set date input to today - const today = new Date().toISOString().split('T')[0]; + const today = this.holidayProvider.formatDate(new Date()); document.getElementById('duty-date').value = today; this.updateDateStepperState(); @@ -330,10 +335,7 @@ class DienstplanApp { const newDay = curDay + delta; if (newDay < 1 || newDay > lastDay) return; // clamp const newDate = new Date(year, month - 1, newDay, 12, 0, 0); - const yyyy = newDate.getFullYear(); - const mm = String(newDate.getMonth() + 1).padStart(2, '0'); - const dd = String(newDate.getDate()).padStart(2, '0'); - dateInput.value = `${yyyy}-${mm}-${dd}`; + dateInput.value = this.holidayProvider.formatDate(newDate); this.updateDateStepperState(); } @@ -402,9 +404,7 @@ class DienstplanApp { const duties = this.storage.getDutiesForMonth(employeeName, year, month); if (duties.length === 0) { - const monthNames = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', - 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']; - container.innerHTML = `
Keine Dienste für ${monthNames[month - 1]} ${year}.
`; + container.innerHTML = `Keine Dienste für ${monthName(month)} ${year}.
`; return; } @@ -463,10 +463,7 @@ class DienstplanApp { const results = this.calculator.calculateAllEmployees(employeeDuties, vacationMap); - const monthNames = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', - 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']; - - resultsContainer.innerHTML = `