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

Add New Methods: subDay, getLastWeek, addDay, getLastMonth #157

Merged
merged 7 commits into from
Mar 22, 2023

Conversation

majidalaeinia
Copy link

@majidalaeinia majidalaeinia commented Jan 12, 2023

  • subDay
  • getLastWeek
  • addDay
  • getLastMonth

@majidalaeinia majidalaeinia changed the title Add New Methods Add New Methods: subDay, getLastWeek, addDay, getLastMonth Jan 12, 2023
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());
Copy link
Owner

Choose a reason for hiding this comment

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

use addDays(1) here

Copy link
Author

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.

Copy link
Owner

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());

Copy link
Author

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));
Copy link
Owner

Choose a reason for hiding this comment

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

use subDays(1) here

Copy link
Author

@majidalaeinia majidalaeinia Mar 19, 2023

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.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

@morilog morilog merged commit 1cefc64 into morilog:master Mar 22, 2023
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.

2 participants