reference/intl/dateformatter/get-calendar.xml
b2332afcd09ceceed83d1e82ad94d7734012bd6f
...
...
@@ -11,16 +11,16 @@
11
11
<para>
12
12
&style.oop;
13
13
</para>
14
-
<methodsynopsis>
15
-
<type>int</type><methodname>IntlDateFormatter::getCalendar</methodname>
16
-
<void />
17
-
</methodsynopsis>
14
+
<methodsynopsis role="IntlDateFormatter">
15
+
<modifier>public</modifier> <type class="union"><type>int</type><type>false</type></type><methodname>IntlDateFormatter::getCalendar</methodname>
16
+
<void/>
17
+
</methodsynopsis>
18
18
<para>
19
19
&style.procedural;
20
20
</para>
21
21
<methodsynopsis>
22
-
<type>int</type><methodname>datefmt_get_calendar</methodname>
23
-
<methodparam><type>IntlDateFormatter</type><parameter>fmt</parameter></methodparam>
22
+
<type class="union"><type>int</type><type>false</type></type><methodname>datefmt_get_calendar</methodname>
23
+
<methodparam><type>IntlDateFormatter</type><parameter>formatter</parameter></methodparam>
24
24
</methodsynopsis>
25
25
<para>
26
26
</para>
...
...
@@ -31,7 +31,7 @@
31
31
<para>
32
32
<variablelist>
33
33
<varlistentry>
34
-
<term><parameter>fmt</parameter></term>
34
+
<term><parameter>formatter</parameter></term>
35
35
<listitem>
36
36
<para>
37
37
The formatter resource
...
...
@@ -50,6 +50,7 @@
50
50
type</link> being used by the formatter. Either
51
51
<constant>IntlDateFormatter::TRADITIONAL</constant> or
52
52
<constant>IntlDateFormatter::GREGORIAN</constant>.
53
+
Returns &false; on failure.
53
54
</para>
54
55
</refsect1>
55
56
...
...
@@ -94,6 +95,27 @@ echo 'Now calendar of the formatter is : ' . $fmt->getCalendar();
94
95
]]>
95
96
</programlisting>
96
97
</example>
98
+
<example>
99
+
<title>Example of invalid locale handling</title>
100
+
<programlisting role="php">
101
+
<![CDATA[
102
+
<?php
103
+
try {
104
+
$fmt = new IntlDateFormatter(
105
+
'invalid_locale',
106
+
IntlDateFormatter::FULL,
107
+
IntlDateFormatter::FULL,
108
+
'dunno',
109
+
IntlDateFormatter::GREGORIAN,
110
+
);
111
+
$cal = $fmt->getCalendar();
112
+
} catch (\Error $e) {
113
+
// ...
114
+
}
115
+
?>
116
+
]]>
117
+
</programlisting>
118
+
</example>
97
119
&example.outputs;
98
120
<screen>
99
121
<![CDATA[
...
...
@@ -114,7 +136,6 @@ Now calendar of the formatter is : 0
114
136
</para>
115
137
</refsect1>
116
138
</refentry>
117
-

118
139
<!-- Keep this comment at the end of the file
119
140
Local variables:
120
141
mode: sgml
121
142