Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First weekday on Week iterator #38

Open
tbleckert opened this issue Nov 15, 2014 · 2 comments
Open

First weekday on Week iterator #38

tbleckert opened this issue Nov 15, 2014 · 2 comments

Comments

@tbleckert
Copy link

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.

@alexmglover
Copy link

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

@yohang
Copy link
Owner

yohang commented Dec 28, 2015

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants