Skip to content

Commit

Permalink
[PHP 8.3] IntlCalendar setDate / setDateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
saundefined committed Nov 6, 2023
1 parent 5787d74 commit bed8176
Show file tree
Hide file tree
Showing 2 changed files with 225 additions and 0 deletions.
99 changes: 99 additions & 0 deletions reference/intl/intlcalendar/setdate.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="intlcalendar.setdate" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>IntlCalendar::setDate</refname>
<refpurpose>Set a date fields</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="IntlCalendar">
<modifier>public</modifier> <type>void</type><methodname>IntlCalendar::setDate</methodname>
<methodparam><type>int</type><parameter>year</parameter></methodparam>
<methodparam><type>int</type><parameter>month</parameter></methodparam>
<methodparam><type>int</type><parameter>dayOfMonth</parameter></methodparam>
</methodsynopsis>
<para>
Sets a date fields to the given value.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>year</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_YEAR</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>month</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_MONTH</constant>.
The month sequence is zero-based, i.e., January is represented by 0,
February by 1, …, December is 11 and Undecember (if the calendar has
it) is 12.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dayOfMonth</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_DAY_OF_MONTH</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>IntlCalendar::setDate</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$intlCal = IntlCalendar::createInstance('UTC');
$intlCal->setDate(2012, 1, 29);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
126 changes: 126 additions & 0 deletions reference/intl/intlcalendar/setdatetime.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="intlcalendar.setdatetime" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>IntlCalendar::setDateTime</refname>
<refpurpose>Set a date and time fields</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="IntlCalendar">
<modifier>public</modifier> <type>void</type><methodname>IntlCalendar::setDateTime</methodname>
<methodparam><type>int</type><parameter>year</parameter></methodparam>
<methodparam><type>int</type><parameter>month</parameter></methodparam>
<methodparam><type>int</type><parameter>dayOfMonth</parameter></methodparam>
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
<methodparam><type>int</type><parameter>minute</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>second</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
Sets a date and time fields to the given value.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>year</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_YEAR</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>month</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_MONTH</constant>.
The month sequence is zero-based, i.e., January is represented by 0,
February by 1, …, December is 11 and Undecember (if the calendar has
it) is 12.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dayOfMonth</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_DAY_OF_MONTH</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>hour</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_HOUR_OF_DAY</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>minute</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_MINUTE</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>second</parameter></term>
<listitem>
<para>
The new value for <constant>IntlCalendar::FIELD_SECOND</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>IntlCalendar::setDateTime</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$intlCal = IntlCalendar::createInstance('UTC');
$intlCal->setDateTime(2012, 1, 29, 23, 58);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

0 comments on commit bed8176

Please sign in to comment.