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

Piwik_Period_Day->toString() should support variable formats #1888

Closed
anonymous-matomo-user opened this issue Dec 14, 2010 · 6 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

The toString() method is hard-coded to "Y-m-d" format. It should accept an override with a default parameter of Y-m-d for backwards compatibility.

@robocoder
Copy link
Contributor

mrisher: What's your use case?

btw if we change the method signature, this should be uniform across Period.php and Period/*.php.

@anonymous-matomo-user
Copy link
Author

Sorry, I had replied but received a bug.

I agree about changing the other Period/* files. This syntax matches that of Date.php so for consistency it seems worth adding.

The use case is, I have a downstream data provider that is being merged into a plugin, and it requires a specific date format with a different delimiter.

I can make the change and check in; should I attach Patch files here or do it in SVN?

Thank you,
/m

@mattab
Copy link
Member

mattab commented Dec 20, 2010

please attach your patch, thanks

@anonymous-matomo-user
Copy link
Author

Period.php, Day.php, and Range.php have toString() methods, so I have updated those.
Week.php, Month.php, and Year.php do not have a toString() method, so I have not changed those in this fix.

@anonymous-matomo-user
Copy link
Author

Attachment: Patch to close this ticket.
patch

@mattab
Copy link
Member

mattab commented Jan 16, 2011

(In [3755]) Fixes #1888
Note: Year Period is not toStringable - does it still solve your use case?

@anonymous-matomo-user anonymous-matomo-user added this to the 1.x - Piwik 1.x milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants