DateTime-Locale
    
    
  
  
  
view release on metacpan or search on metacpan
lib/DateTime/Locale/Base.pm view on Meta::CPAN
Most names come in a number of variations. First, they may vary based on
length, with wide, abbreviated, and narrow forms. The wide form is typically
the full name, while the narrow form is often a single character. The narrow
forms may not be unique. For example, "T" may be used for Tuesday and Thursday
in the English narrow forms.
Many names also distinguish between "format" and "stand-alone" forms of a
pattern. The format pattern is used when the thing in question is being placed
into a larger string. The stand-alone form is used when displaying that item by
itself, for example in a calendar.
=head1 METHODS
All locales provide the following methods:
=over 4
=item * $locale->id()
The locale's id.
lib/DateTime/Locale/FromData.pm view on Meta::CPAN
=head2 $locale->era_wide
=head2 $locale->era_abbreviated
=head2 $locale->era_narrow
These 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.
B<These methods return a reference to the data stored in the locale object. If
you change this reference's contents, this will affect the data in the locale
object! You should clone the data first if you want to modify it.>
=head2 $locale->date_format_full
tools/lib/ModuleGenerator/Locale.pm view on Meta::CPAN
}
sub _build_cldr_json_data ($self) {
    my $json = $self->_json_from( $self->_json_file );
    my $json_file_id = $self->_json_file->parent->basename;
    my $cldr         = $json->{main}{$json_file_id};
    # https://unicode-org.atlassian.net/browse/CLDR-14361
    if (   $self->code =~ /^sd-Deva/
        && $cldr->{dates}{calendars}{gregorian}{quarters}{format}{narrow}{4}
        == 1 ) {
        $cldr->{dates}{calendars}{gregorian}{quarters}{format}{narrow}{4} = 4;
    }
    return $cldr;
}
sub _build_data_hash ($self) {
    my $cal_root = $self->_cldr_json_data->{dates}{calendars}{gregorian};
    my %data = (
        ## no critic (ValuesAndExpressions::ProhibitCommaSeparatedStatements)
        am_pm_abbreviated =>
            [ $cal_root->{dayPeriods}{format}{abbreviated}->@{ 'am', 'pm' } ],
        available_formats => $cal_root->{dateTimeFormats}{availableFormats},
        code              => $self->code,
        first_day_of_week => $self->_first_day_of_week,
        version           => $self->version,
        $self->_glibc_data->%*,
( run in 0.609 second using v1.01-cache-2.11-cpan-5dc5da66d9d )