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

Changed toIso8601String helper function #1063

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@afrojuju1
Copy link

afrojuju1 commented Jan 10, 2018

Changed toIso8601String to take in a boolean which when false would remove the timezone from ISO8601 string.
This adds extra flexibility around ISO8601 string format.

added withTimezone param to toIso8601String helper function
This adds extra flexibility around ISO8601 string format
@Glavic

This comment has been minimized.

Copy link
Collaborator

Glavic commented Feb 13, 2018

If you need custom format, why don't you use ->format() method?

@kylekatarnls

This comment has been minimized.

Copy link
Collaborator

kylekatarnls commented Feb 13, 2018

Each ->toX method should be reserved for one format. I recommend you to extend the class (or use a macro if you work with Laravel) to create an other method for your custom format.

@briannesbitt

This comment has been minimized.

Copy link
Owner

briannesbitt commented Feb 13, 2018

We would implement this as a separate method anyway, no boolean param. But regardless, doesn't need to go into Carbon. Sounds like a good place for your own class.

kylekatarnls added a commit to kylekatarnls/Carbon that referenced this pull request Apr 13, 2018

@kylekatarnls

This comment has been minimized.

Copy link
Collaborator

kylekatarnls commented Apr 13, 2018

Will appear in the documentation:
gh-pages...kylekatarnls:gh-pages-1.26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.