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