Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $stunden = 230;
- $arbeitsTag = 8;
- $startDate = DateTime::createFromFormat('Y-m-d','2019-01-01');
- $holidaysDE = JspitHoliday::create("DE");
- do {
- if($startDate->format('N') > 5){ //6 ist samstag und 7 ist sonntag
- $startDate->modify('+1 day');
- continue;
- }
- if($holidaysDE->isHoliday($startDate)){ //https://github.com/jspit-de/holiday
- $startDate->modify('+1 day');
- continue;
- }
- //insert into
- $stunden -= $arbeitsTag;
- $startDate->modify('+1 day');
- }while($stunden !== 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement