I doing calendar and I'm now stacked on week period of event. I can't do that, it works, but only for next month and others months not.
$i = 1;
$den = $post->day;
$mesic = $array['month'];
$rok = $array['year'];
$minusDays = $this->numDays(date('l', $den.".".$mesi.".".$rok));
$startedWeek = date('W', strtotime($den.".".$post->month.".".$post->year));
$actualWeek = date('W', Time());
$startedWeek = $actualWeek - $startedWeek;
for($i; $i<6; $i++){
if($i==1){
$startedWeek = $startedWeek;
}else{
$startedWeek = $startedWeek+1;
}
$plusDay = date('j', strtotime($den.".".$mesic.".".$rok." + ".$startedWeek." weeks - ".$minusDays." days"));
$plusWeek = date('n',strtotime($den.".".$mesic.".".$rok." + ".$startedWeek." weeks - ".$minusDays." days"));
$plusYear = date('Y',strtotime($den.".".$mesic.".".$rok." + ".$startedWeek." weeks - ".$minusDays." days"));
echo "<input type='hidden' class='interval' data-id='".$post->id."' data-name='".$post->name."' data-d='".$plusDay."' data-day='".$plusDay."'
data-before='".$post->remindBefore."' data-unit='".$post->remindBeforeUnit."' data-remindBy='".$post->remindBy."' data-remindInterval='".$post->remindInterval."'
data-eventTimeH='".$post->remindH."' data-eventTimeM='".$post->remindM."'>";
}
$post->day is day of period, $array['month'] is now listed month, $array['year'] is now listed year. Function numDays returning 0-6 deppends on what day is it. Thank you. It must be in hidden becouse HTML 5 calendar.
There is it ok, it is in column St, next month is same, but 2 months next it is in column Čt.