Skip to content

Changed toIso8601String helper function #1063

Closed
afrojuju1 wants to merge 1 commit into
briannesbitt:masterfrom
afrojuju1:master
Closed

Changed toIso8601String helper function #1063
afrojuju1 wants to merge 1 commit into
briannesbitt:masterfrom
afrojuju1:master

Conversation

@afrojuju1

Copy link
Copy Markdown

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.

This adds extra flexibility around ISO8601 string format
@Glavic

Glavic commented Feb 13, 2018

Copy link
Copy Markdown
Collaborator

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

@kylekatarnls

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Owner

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.

@Glavic Glavic added the macro candidate Rather than new methods, this could be a macro/mixin label Feb 14, 2018
kylekatarnls added a commit to kylekatarnls/Carbon that referenced this pull request Apr 13, 2018
@kylekatarnls

Copy link
Copy Markdown
Collaborator

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

@kylekatarnls kylekatarnls added documentation Rely to documentations or gh-pages branch and removed macro candidate Rather than new methods, this could be a macro/mixin labels Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Rely to documentations or gh-pages branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants