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

Correct Day of Week Parsing #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nokios
Copy link

@nokios nokios commented Mar 17, 2021

This class states that Sunday is 0, but then uses 'MO' as the first element of the array. As a result, the $weekday is wrong, and is one day off.

This class states that Sunday is 0, but then uses 'MO' as the first element of the array. As a result, the `$weekday` is wrong, and is one day off.
@simshaun
Copy link
Owner

This causes lots of test failures. I don't have time to look in to the issue right now. If you do, you can run the tests with ./vendor/bin/phpunit

@nokios
Copy link
Author

nokios commented Mar 26, 2021

I will attempt to have a go at it probably next week.

@@ -41,7 +41,7 @@ class Weekday
/** @var int nth occurrence of the weekday */
public $num;

protected $days = array('MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU');
protected $days = array('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an RFC that says what day is first ? (even if $weekday says 0 is Sunday)

@gazben
Copy link

gazben commented Nov 24, 2022

I got into problems regarding the issue too. Here is my solution: #203

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

Successfully merging this pull request may close these issues.

4 participants