Re: datetime-namespace.pod

2003-06-10 Thread Joshua Hoblitt
Added a missing head tag. -J -- On Mon, 9 Jun 2003, Joshua Hoblitt wrote: Here is the document I started that lists the DT namespaces. It's been just sitting on my disk for several weeks so I figure I might as well get it finished. It's pretty short on details - although I don't think

Re: Converting to DT

2003-06-10 Thread Tim Bunce
On Mon, Jun 09, 2003 at 06:16:23PM -0500, Dave Rolsky wrote: On Mon, 9 Jun 2003, Joshua Hoblitt wrote: I just got back from Perl Whirl. Having spent most of the last week plugging DT as a replacement for many of the examples given in the talks, I think we need a converting to DT section

Re: First things first

2003-06-10 Thread Richard Evans
Dave Rolsky wrote: On Tue, 10 Jun 2003, Rick Measham wrote: Anyway, I've applied it mostly, except that for era I used ACE and BCE, because I'm really not comfortable favoring one religion over another inside the core code. That's cool .. I imagine that we'll change it in short-order

Re: Is there any need to support ISO 639-2 language codes in DT::Locale?

2003-06-10 Thread Richard Evans
On Monday 09 Jun 2003 2:52 am, Eugene van der Pijll wrote: There are many languages that have only a ISO 639-2 code. At the moment, two of them are supported in DateTime (sid = Sidama, and tig = Tigre), and one language without any ISO code (x-drs = sil-drs = Gedeo). All of these are Ethiopian

Re: 3 letter timezones (was month name to number)

2003-06-10 Thread Ben Bennett
Any progress on this? -ben On Wed, Apr 30, 2003 at 12:30:01PM +1000, Rick Measham wrote: On Tue, 29 Apr 2003, Joshua Hoblitt wrote: I was thinking of something similar to the 'constant' syntax that quietly creates namespaces. use DateTime::TimeZone::Alias HST =

Re: Converting to DT

2003-06-10 Thread Joshua Hoblitt
FAQ answers should answer more questions then they generate, but two obvious questions leap out of that code... 1. Why is set_time_zone() needed for this DateTime example? Good point - that should be added to the description. 2. Why use DateTime::Format::*MySQL* when the code may have

Re: Converting to DT

2003-06-10 Thread Ben Bennett
Ah. I am working on that. I decided to use Parse::RecDescent as a base. I have a working ISO8601 (is http://www.w3.org/TR/NOTE-datetime complete?) and I have it parsing simple dates and times... Next on my list is making it understand all of the weird and wonderful things that Date::Manip can

Re: Converting to DT

2003-06-10 Thread Joshua Hoblitt
I am working on that. I decided to use Parse::RecDescent as a base. I have a working ISO8601 (is http://www.w3.org/TR/NOTE-datetime complete?) and I have it parsing simple dates and times... That document isn't anywhere close to what is defined by ISO 8601:2000.

Re: First things first

2003-06-10 Thread Dave Rolsky
On Mon, 9 Jun 2003, Dave Rolsky wrote: Attached is DateTime.diff. This file contains extensions to DateTime to allow it to match the outputs of the ICU project. Strftime has also been patched to allow one to use methods as strftime tokens: '%H' returns the same as '%{hour}' Once

Re: Converting to DT

2003-06-10 Thread Joshua Hoblitt
I played with P::RecDescent for Mason, and it is slow and a memory hog. That's no dis to Damian, cause it's a great tool, but in most cases a custom regex-based parser is way faster. I talked to Damian about it at Perl Whirl and he said he's got plans for a major rewrite. Although we all

Re: Converting to DT

2003-06-10 Thread Dave Rolsky
On Tue, 10 Jun 2003, Joshua Hoblitt wrote: I played with P::RecDescent for Mason, and it is slow and a memory hog. That's no dis to Damian, cause it's a great tool, but in most cases a custom regex-based parser is way faster. I talked to Damian about it at Perl Whirl and he said he's got

Re: First things first

2003-06-10 Thread Rick Measham
At 3:53 PM -0500 10/6/03, Dave Rolsky wrote: Ok, I'm also _really_ confused about week_month(). What the heck is this supposed to return? For July 5, 2001 it's returning 2, which seems wrong to me, since July 5 is clearly part of the first week of July. The comment mentions ISO but I find no

RFC: Adding custom locales to DateTime::Locale

2003-06-10 Thread Richard Evans
Hi everyone It's clear that some folks are going to need custom locales whatever the coverage of the core DT::Locale modules. It's also pretty clear that DT::Locale isn't very friendly when you want to such locales: Currently you have to add an entry into the DateTime::Locale::_locale method

Re: Converting to DT

2003-06-10 Thread Ben Bennett
That's too bad. Anway, I am going to keep playing with this for a bit until I get all of the functionality I want, then I can convert it to a re-based thing. -ben On Tue, Jun 10, 2003 at 03:30:05PM -0500, Dave Rolsky wrote: On Tue, 10 Jun 2003, Ben Bennett wrote: However, I

Re: RFC: Adding custom locales to DateTime::Locale

2003-06-10 Thread Joshua Hoblitt
So this is how it would work - you write custom locales, shove them in one of the @INC paths (preferably different to the DT::Locale install path) and add the LocalInstall module which is used to register your locales. It would be nice if modules could reside in arbitrary namespaces. For

Re: RFC: Adding custom locales to DateTime::Locale

2003-06-10 Thread Dave Rolsky
On Wed, 11 Jun 2003, Rick Measham wrote: I'd really like to not depend on Locale.pm other than as a loader for normal, included Locale methods. Can we just have an API that any module could potentially use? I think we need this, but we may also need a way to hook locales into

Re: RFC: Adding custom locales to DateTime::Locale

2003-06-10 Thread Joshua Hoblitt
Can we just have an API that any module could potentially use? Now thats just entirely too rational. Thank you for articulating my frustration. $locale = new My::Locale; $dt = DateTime-new(%date, locale = $locale); I always assumed that we'd be getting this as it currently works for

Re: RFC: Adding custom locales to DateTime::Locale

2003-06-10 Thread Joshua Hoblitt
Can we just have an API that any module could potentially use? I think we need this, but we may also need a way to hook locales into DateTime::Locale. And I think the next question is: Should this be at run-time or should there be a persistent registry? -J --

DateTime::Duration is_positive bug?

2003-06-10 Thread fglock
In DateTime::Duration: sub new(): ... unless ( grep { $self-{$_} } qw( months days ... { $self-{sign} = 0; } and then: sub is_positive { $_[0]-{sign} == 1 ? 1 : 0 } which makes a zero-duration be not positive, because sign is zero. - Flavio S. Glock

Re: DateTime::Duration is_positive bug?

2003-06-10 Thread Dave Rolsky
On Wed, 11 Jun 2003 [EMAIL PROTECTED] wrote: In DateTime::Duration: sub new(): ... unless ( grep { $self-{$_} } qw( months days ... { $self-{sign} = 0; } and then: sub is_positive { $_[0]-{sign} == 1 ? 1 : 0 } which makes a zero-duration be not positive,

milli/micro seconds

2003-06-10 Thread Joshua Hoblitt
I've started on milliseconds and microseconds support (DT::Duration to start with). I hope nobody else has already done this. -J --