-
Notifications
You must be signed in to change notification settings - Fork 110
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
Add New Methods: subDay
, getLastWeek
, addDay
, getLastMonth
#157
Conversation
subDay
, getLastWeek
, addDay
, getLastMonth
src/Jalalian.php
Outdated
public function addDays(int $days = 1): Jalalian | ||
{ | ||
return static::fromCarbon($this->toCarbon()->addDays($days)); | ||
} | ||
|
||
public function addDay(): Jalalian | ||
{ | ||
return static::fromCarbon($this->toCarbon()->addDays()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use addDays(1)
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I wanted it to be like Carbon
and support the same name, but I can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I mean use addDays(1)
instead of static::fromCarbon($this->toCarbon()->addDays());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/Jalalian.php
Outdated
@@ -354,6 +354,11 @@ public function subDays(int $days = 1): Jalalian | |||
return static::fromCarbon($this->toCarbon()->subDays($days)); | |||
} | |||
|
|||
public function subDay(): Jalalian | |||
{ | |||
return static::fromCarbon($this->toCarbon()->subDays(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use subDays(1)
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I wanted it to be like Carbon
and support the same name, but I can change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
subDay
getLastWeek
addDay
getLastMonth