datetime.perl.org

2003-03-19 Thread Dave Rolsky
I've finally put something useful up there.  Thanks very much to Rick
Measham for the design.

One thing to note is that the developers section contains guidelines for
developing a DateTime::Calendar module, which is something a couple folks
have asked me about in the past.


-dave

/*===
House Absolute Consulting
www.houseabsolute.com
===*/


proposal for DateTime::Astro::Sunrise

2003-03-19 Thread Hill, Ronald
Hi All,

I have been working converting my Astro::Sunrise perl module over to
use the DateTime API. Does the name DateTime::Astro::Sunrise sound good?
I have set the initial version to 0.01_01.
Does anyone object to the name or version?
Please let me know.

Thanks

Ron Hill


Re: datetime.perl.org

2003-03-19 Thread Rick Measham
At 12:02 PM -0600 19/3/03, Dave Rolsky wrote:
I've finally put something useful up there.  Thanks very much to Rick
Measham for the design.
Don't thank me, the design is not my design at all!

All it seems I've done is supply the graphics for the page. The final 
page you've created looks nothing like what was supplied.

You've completely changed the style sheets beyond recognition. We've 
ended up with a page full of text for people who buy large print 
books! The link styles have completely gone out the window, the 
navigation becomes unreadable one I mouse-over it. (The navigation 
isn't even heirarchial).

Why did you bother asking for a design at all? You could easily have 
whipped up a couple of graphics for the title (obviously you have the 
means because you've turned my GIFs into PNGs).

If you're going to leave my name on the bottom of it, then change it 
back to the design I gave you originally. I'll send through the 
graphics for the navigation and page titles. Get rid of the bizzare 
song lyrics in the footer, its made it way too huge.

Don't ask for people to do something and then completely change it. 
Learn to respect the contributions of others.

Cheers!
Rick
--

There are 10 kinds of people:
  those that understand binary, and those that don't.

  The day Microsoft makes something that doesn't suck
is the day they start selling vacuum cleaners

Write a wise proverb and your name will live forever.
   -- Anonymous



Re: ANNOUNCE: DateTime::Format::MySQL 0.01

2003-03-19 Thread Joshua Hoblitt
 This formats and parses MySQL date and time related data types.

I had actually started working on this Sunday and got side tracked after implementing 
just the Mysql Datetime format. :)

It seems like theres going to be a lot of almost identical modules Format::ICal, 
Format::W3CDTF, etc.   That are pretty much recycling the same code.

I'm wondering if maybe we need a DateTime::Format::Custom or maybe just a 
DateTime::Format as a base class ?  That you give a 
DateTime::Format::ICal::valid_formats style definition too.

my $custom_parser = DateTime::Format::Custom-format(
15 =
{ params = [ qw( year month day hour minute second ) ],
regex  = qr/^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)$/,
zero   = {},
},
.
.
);

$custom_parser-parse_datetime( ... );

Or is this just a stupid idea?

-J

--



Re: ANNOUNCE: DateTime::Format::MySQL 0.01

2003-03-19 Thread Iain 'Spoon' Truskett
* Joshua Hoblitt ([EMAIL PROTECTED]) [20 Mar 2003 10:40]:

[...]
 I'm wondering if maybe we need a DateTime::Format::Custom or maybe
 just a DateTime::Format as a base class ? That you give a
 DateTime::Format::ICal::valid_formats style definition too.

DateTime::Format::(Builder|Generic|Factory) (I forget what the
patterns folk are into these days)

 my $custom_parser = DateTime::Format::Custom-format(
   15 = {
   params = [ qw( year month day hour minute second ) ],
   regex  = qr/^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)$/,
   zero   = {},
   },
   ...
 );

Not sure I'd have the '15' bit there. Or is that to let it try
multiple parses?

 $custom_parser-parse_datetime( ... );

 Or is this just a stupid idea?

I like it. Need a formatter too though. e.g.

strftime = %c
strftime = sub { shift-datetime }

or something.


cheers,
-- 
Iain.  http://eh.org/~koschei/


pgp0.pgp
Description: PGP signature


Re: ANNOUNCE: DateTime::Format::MySQL 0.01

2003-03-19 Thread Joshua Hoblitt
 I like it. Need a formatter too though. e.g.

 strftime = %c
 strftime = sub { shift-datetime }

I think we can come up with a better name then strftime.  Maybe keep it around as an 
alias for historical reasons?  I like the the strftime style syntax though.

-J

__



Re: Generic and multi parsers (was: ANNOUNCE: DateTime::Format::MySQL 0.01)

2003-03-19 Thread Iain 'Spoon' Truskett
* Dave Rolsky ([EMAIL PROTECTED]) [20 Mar 2003 16:43]:
 On Thu, 20 Mar 2003, Iain 'Spoon' Truskett wrote:
[...]
  DateTime::Format::(Builder|Generic|Factory) (I forget what the
  patterns folk are into these days)

 I think it'd be Builder, since what it should probably do is construct
 methods for you based on a spec.

Sounds good.

   my $custom_parser = DateTime::Format::Custom-format(
 15 = {
 params = [ qw( year month day hour minute second ) ],
 regex  = qr/^(\d\d\d\d)(\d\d)(\d\d)T(\d\d)(\d\d)(\d\d)$/,
 zero   = {},
 },
 ...
   );
 
  Not sure I'd have the '15' bit there. Or is that to let it try
  multiple parses?

 The 15 is the string length.  In this example, taken from the iCal
 format module, it checks the string length and parses based on that,
 since there are several valid iCal formats each of which is
 distinguishable based on length.

Yeah. I got that =) I was just wondering what the applicability in
DateTime::Format::Builder would be.

I can see a use in, say, having an array of them. As in: try this first,
then this, then this, or fail.

A hash could be useful if order isn't important, and for reporting a
name in some sort of verbose mode:

   $custom_parser-parse_date( Quetzal );
   # Parsed as SavedGame type.   (as a warn or something)

 I think what struck Joshua was the extreme similarity between this,
 the MySQL, and the W3CDTF module.

And, I expect, many more to come. We may well end up with a
DateTime::Format::Common. e.g.:

   my $mysql = DateTime::Format::Common-new( class = 'mysql' );

   my $mysqlstamp = DateTime::Format::Common-new(
class = 'mysql', parser = 'timestamp' );

Or something. No, I'm not fond of the arguments I just wrote.

Theoretically, with a library of the things, you could write a
DateTime::Format::AttemptAll:

   my $parser = DateTime::Format::AttemptAll-new(
output = DateTime::Format::Excel-new );

   my $dt = $parser-parse_date( $some_unknown_string );

   print $parser-format_date( $dt );

where AttemptAll would create a bunch of the parser and try them in a
series. Not fast, but potentially effective.

Or maybe:

   my $chain = DateTime::Format::Chain-new( parsers = [
  DateTime::Format::Excel-new(),
  DateTime::Format::Baby-new(),
  DateTime::Format::W3CDTF-new(),
   ]);

Hmm.

 If someone wants to work on a Builder module, that's fine with me.

I'll be having a play. No guarantees.


cheers,
-- 
Iain.