0.000_014 2017-02-26 T. R. Wyant
Rethink __format interface again. What I think now is that, rather
than a patchwork of method names from two essentially incombatible
interfaces, it should be __fmt_shire_*() for everything. Since
almost all uses of the day and holiday methods in __format() were
day || holiday, get rid of the holiday method (under any name), and
just have __fmt_shire_day, which returns either day or holiday
number. This brings this interface into line with the rest of this
package. But it's not all sweetness and light, because now the
implementations of %Ee and %EE have to explicitly check the month
number.
0.000_013 2017-02-21 T. R. Wyant
Rename __*_short() to __*_abbr(). No idea why I thought _short was
better.
Update README and module front matter.
Expose __valid_date_class() This is the validator for an object
passed as a date to __format(). It is exposed for troubleshooting
purposes.
Add tools/valid-date-class. This is an author's diagnostic to
determine whether the perl package being analyzed has the methods it
needs to be passed to the __format() subroutine as a date object.
0.000_012 2017-02-20 T. R. Wyant
NOT released to CPAN
Modify methods expected by __format in date object. Instead of
year(), month(), day(), holiday(), and weekday() (or day_of_week()),
it is year_number(), etcetera. The motiviation was the equivocation
between Date::Tolkien::Shire and
DateTime::Fiction::JRRTolkien::Shire on some of these.
Ditch the locale code as a bad idea. Instead, go with accented()
and traditional() methods on the date object used by __format().
Fix minor bug in holiday handling in __format().
0.000_011 2017-02-18 T. R. Wyant
NOT released to CPAN
Recode the building of name-to-number hashes so that no
hand-tweaking is needed.
__year_day_to_rata_die() now takes negative years. The validation
mistakenly required non-negative years.
0.000_010 2017-02-18 T. R. Wyant
NOT released to CPAN
Redo __format() in terms of opaque Locale object.
Add __locale() to manufacture this object.
Correct accents in on_date_accented() text.
Remove formats '%EA', '%Ea', and '%ED'. On thinking about it, these
seem to me to be more a locale thing, though how I will get locales
into this package is beyond me at the moment.
Add rudimentary argument validation. The incentive is that I might
want to bolt on a locale system to
DateTime::Fiction::JRRTolkien::Shire, and that might (or might not)
involve adding arguments. So I want to flag extra arguments now, to
reserve them for myself later.
0.000_009 2017-02-15 T. R. Wyant
Ditch special-case __format() code for '%N'. With the
implementation of Glibc field widths, this can now just go through
normal numeric processing, and (I hope) quash an error found by
Andreas König's smoker.
Converge __format() toward Glibc extensions:
- Add user-specified field width.
- Add '0', '_', and '-' padding flags.
- Add '^' and '#' case-change flags.
- Unrecognized specifications are left as-is, except for the actions
of flags. So '%.' remains '%.', rather than becoming '.' as the
BSD functionality would have it. And '%Ez' remains '%Ez' rather
than being interpreted the same as '%z'. But '%^Ez' becomes
'%^EZ', which looks like a bug to me, but that's what Glibc
strftime() does.
Use '%-e' in the implementation of '%Ex', to mimic better the
historical output of (e.g.) Date::Tolkien::Shire->on_date().
Add '%v' (OK, that's a BSD extension, but I could not resist).
0.000_008 2017-02-14 T. R. Wyant
Change __format() format %ED to do __on_date_accented(). The
previous functionality of %ED is obtained (for both %ED and %Ed) by
putting %En before. This causes %ED and %Ed to add a leading "\n",
but only if their result is defined.
Have __format() interpret { month = >0, day => number } as being
equivalent to { holiday => number }, when invoked with a hash rather
than an object.
Add eg/on-date option -accented, which gives you accented proper
nouns.
0.000_007 2017-02-13 T. R. Wyant
First CPAN release.
Add __on_date_accented(). This subroutine wraps __on_date(), but
returns proper nouns accented as they are in The Lord Of The Rings.
0.000_006 2017-02-10 T. R. Wyant
Clean up eg/ scripts.
Add __format format %ED, for on_date() support. This is like %Ed,
but a leading "\n" is added if the result is not null. This means
the usual on_date() method can be duplicated by __format( $date,
'%Ex%n%ED' );
0.000_005 2017-02-08 T. R. Wyant
Add __holiday_name_to_number() and __month_name_to_number().
These convert a holiday name to a holiday number and a month name to a
month number respectively. Numeric arguments are simply returned.
Unrecognized arguments return 0.
Remove creeping 5.8-isms, so that we actually work under 5.6.2.
0.000_004 2017-02-07 T. R. Wyant
Correct __rata_die_to_year_day(). Also test it more exhaustively
(if author) or at least in a more targeted manner (if not).
Also correct GREGORIAN_RATA_DIE_TO_SHIRE, using a better-thought-out
computation.
0.000_003 2017-02-06 T. R. Wyant
Remove Shire-related constant from __year_day_to_rata_die() and
__rata_die_to_year_day(). This way they can be used on any calendar
having the Gregorian year-length rules.
Added exportable manifest constant GREGORIAN_RATA_DIE_TO_SHIRE to
convert from "true" (Gregorian-based) Rata Die to Shire Rata Die.
0.000_002 2017-02-06 T. R. Wyant
Have subroutines return 0 or '' as appropriate (meaning, for legal
dates to which they do not apply, e.g. month-related stuff on a
holiday).
Simplify __format conversion code. This mostly means things like %m on a
holiday producing '00', though it also means requiring a day_of_week()
method on the object passed in. This method was added to the hash
wrapper, implemented by constructing a {day_of_week} entry if one did
not already exist.
0.000_001 2017-02-05 T. R. Wyant
Initial version.