DateTime::Locale::FromData - Class for locale objects instantiated from pre-defined data |
DateTime::Locale::FromData - Class for locale objects instantiated from pre-defined data
version 1.03
my $locale = DateTime::Locale::FromData->new(%lots_of_data)
This class is used to represent locales instantiated from the data in the DateTime::Locale::Data module.
This class provides the following methods:
The following methods all return an array reference containing the specified data.
The methods with ``format'' in the name should return strings that can be used a part of a string, like ``the month of July''. The stand alone values are for use in things like calendars as opposed to a sentence.
The narrow forms may not be unique (for example, in the day column heading for a calendar it's okay to have ``T'' for both Tuesday and Thursday).
The wide name should always be the full name of thing in question. The narrow name should be just one or two characters.
The following methods return strings appropriate for the
DateTime->format_cldr
method:
A locale may also offer one or more formats for displaying part of a datetime, such as the year and month, or hour and minute.
format_for($name)
$locale->format_for(...)
,
where the name is a CLDR-style format specifier.
The return value is a string suitable for passing to $dt->format_cldr
,
so you can do something like this:
print $dt->format_cldr( $dt->locale->format_for('MMMdd') )
which for the ``en'' locale would print out something like ``08 Jul''.
Note that the localization may also include additional text specific to the locale. For example, the ``MMMMd'' format for the ``zh'' locale includes the Chinese characters for ``day'' (日) and month (月), so you get something like ``8月23日''.
$locale->format_for
.
There are also some miscellaneous methods:
Bugs may be submitted through the RT bug tracker (or bug-datetime-locale@rt.cpan.org).
There is a mailing list available for users of this distribution, mailto:datetime@perl.org.
I am also usually active on IRC as 'drolsky' on irc://irc.perl.org
.
Dave Rolsky <autarch@urth.org>
This software is copyright (c) 2016 by Dave Rolsky.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
DateTime::Locale::FromData - Class for locale objects instantiated from pre-defined data |