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

Improve add_duration #115

Open
KES777 opened this issue Nov 27, 2020 · 2 comments
Open

Improve add_duration #115

KES777 opened this issue Nov 27, 2020 · 2 comments

Comments

@KES777
Copy link

KES777 commented Nov 27, 2020

This is related to #108

When adding month this is long to write:

 $date->add( months => 1, end_of_month => 'limit' )

Would be cool if end_of_month parameter could be specified for object itself $date. So for this date math uses limited scheme

 $date->end_of_month( 'limit' )->add( months => 1 )
@KES777
Copy link
Author

KES777 commented Nov 27, 2020

Actually I suppose some flag already implemented and stored at DateTime object, this is how preserve works

@autarch
Copy link
Member

autarch commented Dec 4, 2020

The flag is stored in the DateTime::Duration object, not DateTime. I'm not too keen on adding the flag to DateTime objects. It's just yet more state in there that can make things confusing.

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

No branches or pull requests

2 participants