houseabsolute / DateTime-Format-Builder

Create DateTime parser classes and objects.
http://metacpan.org/release/DateTime-Format-Builder/
Other
0 stars 3 forks source link

DateTime implementation is hardcoded #6

Open autarch opened 4 years ago

autarch commented 4 years ago

Migrated from rt.cpan.org #77223 (status was 'open')

Requestors:

From alucas@cpan.org on 2012-05-15 16:47:07 :

Given that this module is intended to be used as a base for format parsers in the DateTime family, it would be a nice feature if the DateTime class to use was not hardcoded, and was an attribute or something similarly configurable / overridable.

This would be very useful for situations when using a DateTime subclass or non-standard DateTime object with the same interface / constructor signature.

What do you think?

autarch commented 4 years ago

From autarch@urth.org (@autarch) on 2012-05-15 16:52:55 :

On Tue, 15 May 2012, Anthony J Lucas via RT wrote:

Given that this module is intended to be used as a base for format parsers in the DateTime family, it would be a nice feature if the DateTime class to use was not hardcoded, and was an attribute or something similarly configurable / overridable.

This would be very useful for situations when using a DateTime subclass or non-standard DateTime object with the same interface / constructor signature.

What do you think?

I agree. This is a general problem with the DateTime ecosystem. Many modules assume they should call DateTime->new when it'd be nice to make this a parameter.

-dave

/============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================/

autarch commented 4 years ago

From alucas@cpan.org on 2012-05-15 18:14:19 :

On Tue May 15 12:52:55 2012, autarch@urth.org wrote:

On Tue, 15 May 2012, Anthony J Lucas via RT wrote:

Given that this module is intended to be used as a base for format parsers in the DateTime family, it would be a nice feature if the DateTime class to use was not hardcoded, and was an attribute or something similarly configurable / overridable.

This would be very useful for situations when using a DateTime subclass or non-standard DateTime object with the same interface / constructor signature.

What do you think?

I agree. This is a general problem with the DateTime ecosystem. Many modules assume they should call DateTime->new when it'd be nice to make this a parameter.

-dave

/*=========================================================

http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless)

========================================================== ==*/

I've definitely noticed the trend.

I was just in the middle of going through all of the modules I consider important to the DateTime family.

If I wrote a patch for this, would it be accepted? Or did you already have something in mind?

Regards, Anthony L

autarch commented 4 years ago

From autarch@urth.org (@autarch) on 2012-05-15 18:40:06 :

On Tue, 15 May 2012, Anthony J Lucas via RT wrote:

If I wrote a patch for this, would it be accepted? Or did you already have something in mind?

I don't have anything in mind, but however this works, I'd want every similar module to work in the same way.

It probably makes sense to make this a constructor parameter for parsers, something like "datetime_class", and have it default to DateTime.

-dave

/============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================/