Skip Menu |

This queue is for tickets about the Date-Extract CPAN distribution.

Report information
The Basics
Id: 96265
Status: open
Priority: 0/
Queue: Date-Extract

People
Owner: Nobody in particular
Requestors: sharyanto [...] cpan.org
Cc:
AdminCc:

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



Subject: Return multiple formats
This is just a note. I don't have a real-world need for this yet. One might need to extract DateTime objects as well as verbatim date strings out of some text. An option (perhaps the "format" argument being an array or a comma-separated string) can be provided to let one extract them in a single pass.
On Thu Jun 05 20:54:53 2014, SHARYANTO wrote: Show quoted text
> This is just a note. I don't have a real-world need for this yet. > > One might need to extract DateTime objects as well as verbatim date > strings out of some text. An option (perhaps the "format" argument > being an array or a comma-separated string) can be provided to let one > extract them in a single pass.
I just implemented a new format 'combined' which will return each item as hash. The hash will contain 'verbatim', 'pos' (position of date string in text), as well as 'DateTime' (DateTime objects). https://github.com/sharyanto/operl-Date-Extract/commit/f46c085dce432d6d9925155e0acba263e3567230 Please tell me what you guys think of it and whether it should be released. Regards, Steven
If you don't have a real world use case for it, it's probably better to just not include it for now. If and when we do want to include it, I'd certainly lean toward format accepting an array of formats both in the interest of flexibility and self-documentation. Thanks, Shawn