Skip to content

Commit 1a3d078

Browse files
committed
[Sync EN] datetime: DateInterval, DatePeriod et leurs méthodes
1 parent e2caa85 commit 1a3d078

6 files changed

Lines changed: 61 additions & 36 deletions

File tree

reference/datetime/dateinterval.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 9154789dfc9cb8aa5df644bfba5e86c2deba4cb8 Maintainer: behzat Status: ready -->
2+
<!-- EN-Revision: 4d17b7b4947e7819ff5036715dd706be87ae4def Maintainer: behzat Status: ready -->
33
<reference xml:id="class.dateinterval" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
44

55
<title>DateInterval sınıfı</title>

reference/datetime/dateinterval/construct.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 71692b6f4cace8dca72a18ccd80d4cd7305e5d4e Maintainer: behzat Status: ready -->
2+
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: behzat Status: ready -->
33
<refentry xml:id="dateinterval.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
44
<refnamediv>
55
<refname>DateInterval::__construct</refname>
@@ -185,7 +185,9 @@ echo $interval->format("%d");
185185
</programlisting>
186186
&example.outputs;
187187
<screen role="php">
188+
<![CDATA[
188189
7
190+
]]>
189191
</screen>
190192
</example>
191193
</para>
@@ -196,11 +198,8 @@ echo $interval->format("%d");
196198
<programlisting role="php">
197199
<![CDATA[
198200
<?php
199-
200201
$interval = new DateInterval('P1W2D');
201202
var_dump($interval);
202-
203-
?>
204203
]]>
205204
</programlisting>
206205
&example.outputs.82;

reference/datetime/dateinterval/createfromdatestring.xml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: bd1ae73f4a88404c9a3015940c66a85aaeec5889 Maintainer: behzat Status: ready -->
2+
<!-- EN-Revision: c0c9d7721b5a8564a4e27671389a456c1be13e6b Maintainer: behzat Status: ready -->
33
<refentry xml:id="dateinterval.createfromdatestring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
44
<refnamediv>
55
<refname>DateInterval::createFromDateString</refname>
@@ -10,7 +10,7 @@
1010
&reftitle.description;
1111
<para>&style.oop;</para>
1212
<methodsynopsis role="DateInterval">
13-
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>DateInterval</type><type>false</type></type><methodname>DateInterval::createFromDateString</methodname>
13+
<modifier>public</modifier> <modifier>static</modifier> <type>DateInterval</type><methodname>DateInterval::createFromDateString</methodname>
1414
<methodparam><type>string</type><parameter>zaman</parameter></methodparam>
1515
</methodsynopsis>
1616
<para>&style.procedural;</para>
@@ -40,7 +40,7 @@
4040
gösterimler</link> kullanılır.
4141
</para>
4242
<para>
43-
<literal>P7D</literal> gibi bir ISO-8601 biçem dizgesini kullanmak için kurucu gerekir.
43+
<literal>P7D</literal> gibi bir ISO-8601 biçem dizgesini kullanmak için <methodname>DateInterval::__construct</methodname> gerekir.
4444
</para>
4545
</listitem>
4646
</varlistentry>
@@ -51,8 +51,17 @@
5151
<refsect1 role="returnvalues">
5252
&reftitle.returnvalues;
5353
<para>
54-
Başarılıysa yeni bir <classname>DateInterval</classname> nesnesi döndürür,
55-
&return.falseforfailure;.
54+
Başarılıysa bir <classname>DateInterval</classname> döndürür.
55+
&return.falseforfailure.style.procedural;
56+
</para>
57+
</refsect1>
58+
59+
<refsect1 role="errors">
60+
&reftitle.errors;
61+
<para>
62+
Yalnızca Nesneye Yönelik API: Geçersiz bir Tarih/Zaman dizgesi aktarılırsa
63+
<exceptionname>DateMalformedIntervalStringException</exceptionname>
64+
yavrulanır.
5665
</para>
5766
</refsect1>
5867

@@ -67,6 +76,17 @@
6776
</row>
6877
</thead>
6978
<tbody>
79+
<row>
80+
<entry>8.3.0</entry>
81+
<entry>
82+
Geçersiz bir dizge aktarılırsa
83+
<methodname>DateInterval::createFromDateString</methodname> artık
84+
<exceptionname>DateMalformedIntervalStringException</exceptionname>
85+
yavruluyor. Evvelce <literal>false</literal> dönerdi ve bir uyarı
86+
üretirdi. <function>date_interval_create_from_date_string</function>
87+
işlevinin davranışı değişmedi.
88+
</entry>
89+
</row>
7090
<row>
7191
<entry>8.2.0</entry>
7292
<entry>
@@ -84,7 +104,7 @@
84104
<para>
85105
<example>
86106
<title>- Geçerli tarih aralıklarının çözümlenmesi</title>
87-
<programlisting role="php">
107+
<programlisting role="php" annotations="non-interactive">
88108
<![CDATA[
89109
<?php
90110
// Aralıklar her birinde eşittir.
@@ -108,7 +128,6 @@ $i = DateInterval::createFromDateString('1 day + 12 hours');
108128
109129
$i = new DateInterval('PT3600S');
110130
$i = DateInterval::createFromDateString('3600 seconds');
111-
?>
112131
]]>
113132
</programlisting>
114133
</example>
@@ -124,13 +143,14 @@ echo $i->format('%d %h %i'), "\n";
124143
125144
$i = DateInterval::createFromDateString('1 year - 10 days');
126145
echo $i->format('%y %d'), "\n";
127-
?>
128146
]]>
129147
</programlisting>
130148
&example.outputs;
131-
<screen role="shell">
149+
<screen>
150+
<![CDATA[
132151
449 2 70
133152
1 -10
153+
]]>
134154
</screen>
135155
</example>
136156
</para>

reference/datetime/dateinterval/format.xml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 02ff7fef5b34cf8f5395180d9d39fb64d9398d00 Maintainer: behzat Status: ready -->
2+
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: behzat Status: ready -->
33
<refentry xml:id="dateinterval.format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
44
<refnamediv>
55
<refname>DateInterval::format</refname>
@@ -197,11 +197,8 @@
197197
<programlisting role="php">
198198
<![CDATA[
199199
<?php
200-
201200
$interval = new DateInterval('P2Y4DT6H8M');
202201
echo $interval->format('%d gün');
203-
204-
?>
205202
]]>
206203
</programlisting>
207204
&example.outputs;
@@ -218,11 +215,8 @@ echo $interval->format('%d gün');
218215
<programlisting role="php">
219216
<![CDATA[
220217
<?php
221-
222218
$interval = new DateInterval('P32D');
223219
echo $interval->format('%d gün');
224-
225-
?>
226220
]]>
227221
</programlisting>
228222
&example.outputs;
@@ -242,7 +236,6 @@ echo $interval->format('%d gün');
242236
<programlisting role="php">
243237
<![CDATA[
244238
<?php
245-
246239
$january = new DateTime('2010-01-01');
247240
$february = new DateTime('2010-02-01');
248241
$interval = $february->diff($january);
@@ -252,8 +245,6 @@ echo $interval->format('toplam %a gün')."\n";
252245
253246
// %d ise aya dahil olmayan gün sayısını çıktılar.
254247
echo $interval->format('%m ay, %d gün');
255-
256-
?>
257248
]]>
258249
</programlisting>
259250
&example.outputs;

reference/datetime/dateperiod.xml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: ac83abe55f4da019036de5ec14400d674fa3f9f5 Maintainer: behzat Status: ready -->
2+
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: behzat Status: ready -->
33
<reference xml:id="class.dateperiod" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
44

55
<title>DatePeriod sınıfı</title>
@@ -112,7 +112,10 @@
112112
&reftitle.constants;
113113
<variablelist>
114114
<varlistentry xml:id="dateperiod.constants.exclude-start-date">
115-
<term><constant>DatePeriod::EXCLUDE_START_DATE</constant></term>
115+
<term>
116+
<constant>DatePeriod::EXCLUDE_START_DATE</constant>
117+
<type>int</type>
118+
</term>
116119
<listitem>
117120
<para>
118121
<function>DatePeriod::__construct</function> yönteminde kullanılan
@@ -122,7 +125,10 @@
122125
</varlistentry>
123126

124127
<varlistentry xml:id="dateperiod.constants.include-end-date">
125-
<term><constant>DatePeriod::INCLUDE_END_DATE</constant></term>
128+
<term>
129+
<constant>DatePeriod::INCLUDE_END_DATE</constant>
130+
<type>int</type>
131+
</term>
126132
<listitem>
127133
<para>
128134
<function>DatePeriod::__construct</function> yönteminde kullanılan
@@ -163,7 +169,8 @@
163169
<para>
164170
<informalexample>
165171
<programlisting role="php">
166-
<![CDATA[<?php
172+
<![CDATA[
173+
<?php
167174
$start = new DateTime('2018-12-31 00:00:00');
168175
$end = new DateTime('2021-12-31 00:00:00');
169176
$interval = new DateInterval('P1M');
@@ -185,15 +192,17 @@ echo $period->recurrences, "\n";
185192
186193
$period = new DatePeriod($start, $interval, $end, DatePeriod::EXCLUDE_START_DATE);
187194
echo $period->recurrences, "\n";
188-
?>]]>
195+
]]>
189196
</programlisting>
190197
&example.outputs;
191198
<screen role="php">
199+
<![CDATA[
192200
5
193201
6
194202
7
195203
1
196204
0
205+
]]>
197206
</screen>
198207
</informalexample>
199208
</para>
@@ -265,6 +274,12 @@ echo $period->recurrences, "\n";
265274
</row>
266275
</thead>
267276
<tbody>
277+
<row>
278+
<entry>8.4.0</entry>
279+
<entry>
280+
Sınıf sabitleri artık tür belirtimli.
281+
</entry>
282+
</row>
268283
<row>
269284
<entry>8.2.0</entry>
270285
<entry>

reference/datetime/dateperiod/construct.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!-- EN-Revision: 7d81260767f008218ffd338b365cfa3d10eb3d15 Maintainer: behzat Status: ready -->
2+
<!-- EN-Revision: 0cf48a5a4869bd8b42f84e7032076756cde6a474 Maintainer: behzat Status: ready -->
33
<refentry xml:id="dateperiod.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
44
<refnamediv>
55
<refname>DatePeriod::__construct</refname>
@@ -24,15 +24,17 @@
2424
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
2525
</constructorsynopsis>
2626
<warning>
27+
<simpara>
28+
Aşağıdaki kurucu kullanımı artık önerilmiyor:
29+
</simpara>
2730
<constructorsynopsis role="DatePeriod">
2831
<modifier>public</modifier> <methodname>DatePeriod::__construct</methodname>
2932
<methodparam><type>string</type><parameter>isostr</parameter></methodparam>
3033
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
3134
</constructorsynopsis>
3235
<simpara>
33-
Bu kullanım artık önerilmiyor, yerine
34-
<methodname>DatePeriod::createFromISO8601String</methodname>
35-
kullanılmalıdır.
36+
Yerine <methodname>DatePeriod::createFromISO8601String</methodname>
37+
durağan üretici yöntemi kullanılmalıdır.
3638
</simpara>
3739
</warning>
3840
<para>
@@ -214,12 +216,12 @@ $period = new DatePeriod($iso);
214216
foreach ($period as $date) {
215217
echo $date->format('Y-m-d')."\n";
216218
}
217-
?>
218219
]]>
219220
</programlisting>
220221
&example.outputs;
221222
<screen>
222223
<![CDATA[
224+
Deprecated: Calling DatePeriod::__construct(string $isostr, int $options = 0) is deprecated, use DatePeriod::createFromISO8601String() instead in script on line 11
223225
2012-07-01
224226
2012-07-08
225227
2012-07-15
@@ -249,7 +251,6 @@ $period = new DatePeriod($start, $interval, $end,
249251
foreach ($period as $date) {
250252
echo $date->format('Y-m-d')."\n";
251253
}
252-
?>
253254
]]>
254255
</programlisting>
255256
&example.outputs;
@@ -278,7 +279,6 @@ $period = new DatePeriod($begin, $interval, $end, DatePeriod::EXCLUDE_START_DATE
278279
foreach ($period as $dt) {
279280
echo $dt->format('l Y-m-d'), "\n";
280281
}
281-
?>
282282
]]>
283283
</programlisting>
284284
&example.outputs;

0 commit comments

Comments
 (0)