Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime CPAN distribution.

Report information
The Basics
Id: 117799
Status: resolved
Priority: 0/
Queue: DateTime

People
Owner: Nobody in particular
Requestors: nebulous [...] crashed.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: TO_JSON
Often I will subclass (or yes, sometimes monkeypatch like an idiot), DateTime in order to add a TO_JSON method: sub TO_JSON { shift->iso8601.'Z' } Would it be possible/advisable to add said method to DateTime itself? If so I'll be happy to submit a PR with tests.
On 2016-09-12 14:16:00, NEBULOUS wrote: Show quoted text
> Often I will subclass (or yes, sometimes monkeypatch like an idiot), > DateTime in order to add a TO_JSON method: > > sub TO_JSON { shift->iso8601.'Z' } > > Would it be possible/advisable to add said method to DateTime itself? > If so I'll be happy to submit a PR with tests.
Yes, see https://github.com/houseabsolute/DateTime.pm/pull/12 for some context.