* Dave Rolsky ([EMAIL PROTECTED]) [31 Mar 2003 02:35]:
> On Sun, 30 Mar 2003, Iain 'Spoon' Truskett wrote:
> > Something I need for strptime. Any objections?
> how about am_pm_list for the name? "am_pms" is just weird ;)
How's the following? Give a 'yay' or 'nay' and I'll commit
appropriately (I don't like touching other people's projects without
an explicit "do it"; and, no, that's not a subtle way of disapproving
your changes to the module I started; I thoroughly approved of those,
and will of anyone else doing so).
Index: Changes
===================================================================
RCS file: /cvsroot/perl-date-time/modules/DateTime.pm/Changes,v
retrieving revision 1.33
diff -u -r1.33 Changes
--- Changes 1 Apr 2003 02:31:03 -0000 1.33
+++ Changes 1 Apr 2003 05:26:02 -0000
@@ -14,6 +14,8 @@
- Allow from_epoch(), now(), and today() to accept a time_zone
parameter. Based on suggestions from Tim Bunce and Joshua Hoblitt.
+- Allow extraction of AM/PM string list from DateTime::Language classes.
+
[BUG FIXES]
- If a datetime had the floating timezone and then set_time_zone was
Index: lib/DateTime/Language.pm
===================================================================
RCS file: /cvsroot/perl-date-time/modules/DateTime.pm/lib/DateTime/Language.pm,v
retrieving revision 1.11
diff -u -r1.11 Language.pm
--- lib/DateTime/Language.pm 20 Mar 2003 06:13:02 -0000 1.11
+++ lib/DateTime/Language.pm 1 Apr 2003 05:26:02 -0000
@@ -126,6 +126,8 @@
sub day_abbreviation { $_[0]->{day_abbreviations}[ $_[1]->day_of_week_0 ] }
+sub am_pm_list { $_[0]->{am_pm} }
+
sub am_pm { $_[0]->{am_pm}[ $_[1]->hour < 12 ? 0 : 1 ] }
#sub preferred_datetime_format { '%m/%d/%y %H:%M:%S' }
@@ -269,6 +271,11 @@
Given a C<DateTime> object, this method should return the correct day
abbreviation.
+
+=item * am_pm_list
+
+Returns a list of the AM/PM texts. First item should be the AM, the
+second should be the PM.
=item * am_pm( $dt )