1DateTime::Locale::Base(U3s)er Contributed Perl DocumentatDiaotneTime::Locale::Base(3)
2
3
4
6 DateTime::Locale::Base - Base class for individual locale objects
7
9 version 1.22
10
12 use base 'DateTime::Locale::Base';
13
15 This module is no longer used by the code in the distribution. It is
16 still included for the sake of any code out in the wild that may
17 subclass this class. This class will be removed in a future release.
18
20 Each locale has a set of four default date and time formats. They are
21 distinguished by length, and are called "full", "long", "medium", and
22 "short". Each locale may have a different default length which it uses
23 when its "$locale->date_format_default()",
24 "$locale->time_format_default()", or
25 "$locale->datetime_format_default()" methods are called.
26
27 This can be changed by calling the "$locale->set_default_date_format()"
28 or "$locale->set_default_time_format()" methods. These methods accept
29 a string which must be one of "full", "long", "medium", or "short".
30
32 Most names come in a number of variations. First, they may vary based
33 on length, with wide, abbreviated, and narrow forms. The wide form is
34 typically the full name, while the narrow form is often a single
35 character. The narrow forms may not be unique. For example, "T" may be
36 used for Tuesday and Thursday in the English narrow forms.
37
38 Many names also distinguish between "format" and "stand-alone" forms of
39 a pattern. The format pattern is used when the thing in question is
40 being placed into a larger string. The stand-alone form is used when
41 displaying that item by itself, for example in a calendar.
42
44 All locales provide the following methods:
45
46 · $locale->id()
47
48 The locale's id.
49
50 · $locale->language_id()
51
52 The language portion of the id.
53
54 · $locale->script_id()
55
56 The script portion of the id, if any.
57
58 · $locale->territory_id()
59
60 The territory portion of the id, if any.
61
62 · $locale->variant_id()
63
64 The variant portion of the id, if any.
65
66 · $locale->name()
67
68 The full name for the locale in English.
69
70 · $locale->language()
71
72 The language name for the locale in English.
73
74 · $locale->script()
75
76 The script name for the locale in English, if any.
77
78 · $locale->territory()
79
80 The territory name for the locale in English, if any.
81
82 · $locale->variant()
83
84 The variant name for the locale in English, if any.
85
86 · $locale->native_name()
87
88 The full name for the locale in its native language, if any.
89
90 · $locale->native_language()
91
92 The language name for the locale in its native language, if any.
93
94 · $locale->native_script()
95
96 The script name for the locale in its native language, if any.
97
98 · $locale->native_territory()
99
100 The territory name for the locale in its native language, if any.
101
102 · $locale->native_variant()
103
104 The variant name for the locale in its native language, if any.
105
106 · $locale->month_format_wide()
107
108 Returns an array reference containing the wide format names of the
109 months, with January as the first month.
110
111 · $locale->month_format_abbreviated()
112
113 Returns an array reference containing the abbreviated format names
114 of the months, with January as the first month.
115
116 · $locale->month_format_narrow()
117
118 Returns an array reference containing the narrow format names of
119 the months, with January as the first month.
120
121 · $locale->month_stand_alone_wide()
122
123 Returns an array reference containing the wide stand-alone names of
124 the months, with January as the first month.
125
126 · $locale->month_stand_alone_abbreviated()
127
128 Returns an array reference containing the abbreviated stand-alone
129 names of the months, with January as the first month.
130
131 · $locale->month_stand_alone_narrow()
132
133 Returns an array reference containing the narrow stand-alone names
134 of the months, with January as the first month.
135
136 · $locale->day_format_wide()
137
138 Returns an array reference containing the wide format names of the
139 days, with Monday as the first day.
140
141 · $locale->day_format_abbreviated()
142
143 Returns an array reference containing the abbreviated format names
144 of the days, with Monday as the first day.
145
146 · $locale->day_format_narrow()
147
148 Returns an array reference containing the narrow format names of
149 the days, with Monday as the first day.
150
151 · $locale->day_stand_alone_wide()
152
153 Returns an array reference containing the wide stand-alone names of
154 the days, with Monday as the first day.
155
156 · $locale->day_stand_alone_abbreviated()
157
158 Returns an array reference containing the abbreviated stand-alone
159 names of the days, with Monday as the first day.
160
161 · $locale->day_stand_alone_narrow()
162
163 Returns an array reference containing the narrow stand-alone names
164 of the days, with Monday as the first day.
165
166 · $locale->quarter_format_wide()
167
168 Returns an array reference containing the wide format names of the
169 quarters.
170
171 · $locale->quarter_format_abbreviated()
172
173 Returns an array reference containing the abbreviated format names
174 of the quarters.
175
176 · $locale->quarter_format_narrow()
177
178 Returns an array reference containing the narrow format names of
179 the quarters.
180
181 · $locale->quarter_stand_alone_wide()
182
183 Returns an array reference containing the wide stand-alone names of
184 the quarters.
185
186 · $locale->quarter_stand_alone_abbreviated()
187
188 Returns an array reference containing the abbreviated stand-alone
189 names of the quarters.
190
191 · $locale->quarter_stand_alone_narrow()
192
193 Returns an array reference containing the narrow stand-alone names
194 of the quarters.
195
196 · $locale->era_wide()
197
198 Returns an array reference containing the wide names of the eras,
199 with "BCE" first.
200
201 · $locale->era_abbreviated()
202
203 Returns an array reference containing the abbreviated names of the
204 eras, with "BCE" first.
205
206 · $locale->era_narrow()
207
208 Returns an array reference containing the abbreviated names of the
209 eras, with "BCE" first. However, most locales do not differ between
210 the narrow and abbreviated length of the era.
211
212 · $locale->am_pm_abbreviated()
213
214 Returns an array reference containing the abbreviated names of "AM"
215 and "PM".
216
217 · $locale->date_format_long()
218
219 · $locale->date_format_full()
220
221 · $locale->date_format_medium()
222
223 · $locale->date_format_short()
224
225 Returns the CLDR date pattern of the appropriate length.
226
227 · $locale->date_formats()
228
229 Returns a hash reference of CLDR date patterns for the date
230 formats, where the keys are "full", "long", "medium", and "short".
231
232 · $locale->time_format_long()
233
234 · $locale->time_format_full()
235
236 · $locale->time_format_medium()
237
238 · $locale->time_format_short()
239
240 Returns the CLDR date pattern of the appropriate length.
241
242 · $locale->time_formats()
243
244 Returns a hash reference of CLDR date patterns for the time
245 formats, where the keys are "full", "long", "medium", and "short".
246
247 · $locale->datetime_format_long()
248
249 · $locale->datetime_format_full()
250
251 · $locale->datetime_format_medium()
252
253 · $locale->datetime_format_short()
254
255 Returns the CLDR date pattern of the appropriate length.
256
257 · $locale->datetime_formats()
258
259 Returns a hash reference of CLDR date patterns for the datetime
260 formats, where the keys are "full", "long", "medium", and "short".
261
262 · $locale->date_format_default()
263
264 · $locale->time_format_default()
265
266 · $locale->datetime_format_default()
267
268 Returns the default CLDR date pattern. The length of this format is
269 based on the value of "$locale->default_date_format_length()"
270 and/or "$locale->default_time_format_length()".
271
272 · $locale->default_date_format_length()
273
274 · $locale->default_time_format_length()
275
276 Returns the default length for the format, one of "full", "long",
277 "medium", or "short".
278
279 · $locale->set_default_date_format_length()
280
281 · $locale->set_default_time_format_length()
282
283 Sets the default length for the format. This must be one of "full",
284 "long", "medium", or "short".
285
286 · $locale->prefers_24_hour_time()
287
288 Returns a boolean indicating the preferred hour format for this
289 locale.
290
291 · $locale->first_day_of_week()
292
293 Returns a number from 1 to 7 indicating the local first day of the
294 week, with Monday being 1 and Sunday being 7. For example, for a US
295 locale this returns 7.
296
297 · $locale->available_formats()
298
299 A list of format names, like "MMdd" or "yyyyMM". This should be the
300 list directly supported by the subclass, not its parents.
301
302 · $locale->format_for($key)
303
304 Given a valid name, returns the CLDR date pattern for that thing,
305 if one exists.
306
308 See DateTime::Locale.
309
310 Bugs may be submitted at
311 <https://github.com/houseabsolute/DateTime-Locale/issues>.
312
313 There is a mailing list available for users of this distribution,
314 <mailto:datetime@perl.org>.
315
316 I am also usually active on IRC as 'autarch' on "irc://irc.perl.org".
317
319 The source code repository for DateTime-Locale can be found at
320 <https://github.com/houseabsolute/DateTime-Locale>.
321
323 Dave Rolsky <autarch@urth.org>
324
326 This software is copyright (c) 2003 - 2018 by Dave Rolsky.
327
328 This is free software; you can redistribute it and/or modify it under
329 the same terms as the Perl 5 programming language system itself.
330
331 The full text of the license can be found in the LICENSE file included
332 with this distribution.
333
334
335
336perl v5.28.0 2018-06-08 DateTime::Locale::Base(3)