CalendR icon indicating copy to clipboard operation
CalendR copied to clipboard

First weekday on Week iterator

Open tbleckert opened this issue 9 years ago • 2 comments

Why is the first weekday option only working on the Month iterator? When using getWeek(...) and looping through the dates, it always starts with Monday.When using getMonth(...) I get the expected result, the first day is whatever getFirstWeekday() is.

tbleckert avatar Nov 15 '14 19:11 tbleckert

I know this is a really old issue, but I am seeing the same problem.

alexmglover avatar Oct 24 '15 13:10 alexmglover

Hi,

sorry for the delay,

<?php

foreach ($calendar->getWeek(2015, 52) as $day) {
    echo $day, ' ', $day->format('d-m-Y'), "\n";
}

gives me

Sunday 20-12-2015
Monday 21-12-2015
Tuesday 22-12-2015
Wednesday 23-12-2015
Thursday 24-12-2015
Friday 25-12-2015
Saturday 26-12-2015

wich is good. Aren't you on 1.0 version that does not manage first week days ?

yohang avatar Dec 28 '15 10:12 yohang