pmdevelopment / german-holiday-bundle
German Holidays
Installs: 3 725
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^5.5.0|^7.0.19
- symfony/config: ^4.2|^5.0
- twig/twig: ^2.7|^3.0
This package is auto-updated.
Last update: 2024-12-07 17:58:17 UTC
README
Get german legal holidays as symfony2 bundle.
--
Deutsche gesetzliche Feiertage für Symfony2 als Bundle.
Setup
Add to AppKernel
new PM\Bundle\GermanHolidayBundle\PMGermanHolidayBundle(),
Warnings
German holidays are a mess. Corpus christi is city based in Saxony and Thuringia, Assumption day in Bavaria. Those holidays are ignored for those states. Also you should always use the real year you are looking for, because in 2017 reformation day is country wide, so in this year the holidays are different.
Usage
Forms
Your Users probably need the state connection.
->add('state', ChoiceType::class, [
'label' => 'label.state',
'choices_as_values' => true,
'choice_translation_domain' => 'PMGermanHolidayBundle',
'choices' => States::getAll(),
'required' => false,
'preferred_choices' => [
States::HESSE,
],
'placeholder' => 'help.empty',
])
Get All
You can get all holidays by year. De result uses the Holiday
object.
$holidays = $this->getContainer()->get('pm_german_holiday.services.holiday_service')->getAll($year);
More Stuff
The services uses some helper you can also use to get holidays by state or all holidays for one state.