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

Fix #1967 Add auto mode for start/end of week #2090

Conversation

kylekatarnls
Copy link
Collaborator

@kylekatarnls kylekatarnls commented May 19, 2020

Fix #1967

Using:

<?php

Carbon::setWeekStartsAt('auto');
Carbon::setWeekEndsAt('auto');

Carbon::setLocale('en_US'); // or en which is also the default locale

echo Carbon::now()->startOfWeek()->dayName; // Sunday
echo Carbon::now()->endOfWeek()->dayName; // Saturday

@kylekatarnls kylekatarnls force-pushed the feature/issue-1967-start-end-auto-mode branch from 7db8305 to e0e4c4d Compare May 19, 2020 21:49
@codecov-commenter
Copy link

Codecov Report

Merging #2090 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##              master     #2090   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity      1955      1960    +5     
===========================================
  Files            882       882           
  Lines           8520      8528    +8     
===========================================
+ Hits            8520      8528    +8     
Impacted Files Coverage Δ Complexity Δ
src/Carbon/Traits/Options.php 100.00% <ø> (ø) 22.00 <0.00> (ø)
src/Carbon/Traits/Date.php 100.00% <100.00%> (ø) 282.00 <1.00> (+5.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e87404...14bbb61. Read the comment docs.

@kylekatarnls kylekatarnls merged commit ae4f810 into briannesbitt:master May 20, 2020
@kylekatarnls kylekatarnls deleted the feature/issue-1967-start-end-auto-mode branch May 20, 2020 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Week methods only work with local translator, not default locale
2 participants