Skip Menu |

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

Report information
The Basics
Id: 95998
Status: resolved
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 original date strings
Hi, First of all, thanks for this useful module. I need to replace all date strings in a text to a standardized ISO YYYY-MM-DD. Unfortunately, Date::Extract returns DateTime objects and not the original strings. Hopefully an option can be added for this? Regards, Steven
Subject: Re: [rt.cpan.org #95998] Return original date strings
Date: Tue, 27 May 2014 08:50:40 -0700
To: steven haryanto via RT <bug-Date-Extract [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Tue, May 27, 2014 at 05:51:52AM -0400, steven haryanto via RT wrote: Show quoted text
> I need to replace all date strings in a text to a standardized ISO YYYY-MM-DD. Unfortunately, Date::Extract returns DateTime objects and not the original strings. Hopefully an option can be added for this?
I don't understand - can't you just stringify the date object, which will by default give you the ISO8601 formatted string?
On Tue May 27 11:50:52 2014, ETHER wrote: Show quoted text
> On Tue, May 27, 2014 at 05:51:52AM -0400, steven haryanto via RT > wrote:
> > I need to replace all date strings in a text to a standardized ISO > > YYYY-MM-DD. Unfortunately, Date::Extract returns DateTime objects and > > not the original strings. Hopefully an option can be added for this?
> > I don't understand - can't you just stringify the date object, which > will > by default give you the ISO8601 formatted string?
I want to replace the *original* strings (which can be of various formats: "13 Nov 1986", "tomorrow", what have you) *into* ISO8601 strings. BTW, I published an alt implementation on CPAN[1]. Please tell me if it's something you can consider for Date::Extract so I can pull the alt implementation. [1] https://metacpan.org/release/Alt-Date-Extract-SHARYANTO Regards, Steven
On Tue May 27 22:05:28 2014, SHARYANTO wrote: Show quoted text
> On Tue May 27 11:50:52 2014, ETHER wrote:
> > On Tue, May 27, 2014 at 05:51:52AM -0400, steven haryanto via RT > > wrote:
> > > I need to replace all date strings in a text to a standardized ISO > > > YYYY-MM-DD. Unfortunately, Date::Extract returns DateTime objects > > > and > > > not the original strings. Hopefully an option can be added for > > > this?
> > > > I don't understand - can't you just stringify the date object, which > > will > > by default give you the ISO8601 formatted string?
> > I want to replace the *original* strings (which can be of various > formats: "13 Nov 1986", "tomorrow", what have you) *into* ISO8601 > strings. > > BTW, I published an alt implementation on CPAN[1]. Please tell me if > it's something you can consider for Date::Extract so I can pull the > alt implementation. > > [1] https://metacpan.org/release/Alt-Date-Extract-SHARYANTO > > Regards, > Steven
For a concrete example, yesterday I converted the list of Ubuntu releases from the table at: http://en.wikipedia.org/wiki/List_of_Ubuntu_releases into: https://github.com/sharyanto/gudangdata/blob/master/table/ubuntu_release/data.csv Regards, Steven
Subject: Re: [rt.cpan.org #95998] Return original date strings
Date: Wed, 28 May 2014 10:44:32 -0700
To: steven haryanto via RT <bug-Date-Extract [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Tue, May 27, 2014 at 10:05:29PM -0400, steven haryanto via RT wrote: Show quoted text
> I want to replace the *original* strings (which can be of various formats: "13 Nov 1986", "tomorrow", what have you) *into* ISO8601 strings.
Ah, I see, yes that would be useful, and I've wanted to do the same thing myself. Show quoted text
> BTW, I published an alt implementation on CPAN[1]. Please tell me if it's something you can consider for Date::Extract so I can pull the alt implementation. > [1] https://metacpan.org/release/Alt-Date-Extract-SHARYANTO
I'm just driving by -- this is sartak's dist :) paging sartak, paging sartak!
Hi Stevan, On 2014-5月-27 火 05:51:51, SHARYANTO wrote: Show quoted text
> I need to replace all date strings in a text to a standardized ISO > YYYY-MM-DD. Unfortunately, Date::Extract returns DateTime objects and > not the original strings. Hopefully an option can be added for this?
Sure. I'd add an option `format => "verbatim"` with a default of "DateTime". (Your "returns_orig" is a little bit clumsy). If you're feeling particularly generous, `format => "epoch"` would be another obvious addition. :) Thanks! Shawn PS Thank you for helping out, Karen. :)
RT-Send-CC: ether [...] cpan.org
On Wed May 28 13:49:28 2014, SARTAK wrote: Show quoted text
> Hi Stevan, > > On 2014-5月-27 火 05:51:51, SHARYANTO wrote:
> > I need to replace all date strings in a text to a standardized ISO > > YYYY-MM-DD. Unfortunately, Date::Extract returns DateTime objects and > > not the original strings. Hopefully an option can be added for this?
> > Sure. I'd add an option `format => "verbatim"` with a default of > "DateTime". (Your "returns_orig" is a little bit clumsy). If you're > feeling particularly generous, `format => "epoch"` would be another > obvious addition. :) > > Thanks! > Shawn > > PS Thank you for helping out, Karen. :)
Hi Shawn, Um, so who's going to do the implementation? (I don't mind doing it BTW) ;) Couldn't find a link to github repo and couldn't find the repo in your github account also. Regards, Steven
Hi Steven, You now have comaint on Date::Extract. :) I believe the most canonical repo is https://github.com/bestpractical/date-extract. Feel free to fork it. But please do, of course, confirm that that repo has the latest on CPAN. You're welcome to list your fork as the canonical repo in the dist metadata. Thanks, Shawn
On Wed Jun 04 16:21:16 2014, SARTAK wrote: Show quoted text
> Hi Steven, > > You now have comaint on Date::Extract. :) > > I believe the most canonical repo is > https://github.com/bestpractical/date-extract. Feel free to fork it. > But please do, of course, confirm that that repo has the latest on > CPAN. > > You're welcome to list your fork as the canonical repo in the dist > metadata. > > Thanks, > Shawn
I've made a 0.05 release. Hopefully everything's ok :) Regards, Steven
Perfect. Thank you Steven!