<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.intlcalendar.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'intlcalendar.getminimaldaysinfirstweek.php',
    1 => 'IntlCalendar::getMinimalDaysInFirstWeek',
    2 => 'Get minimal number of days the first week in a year or month can have',
  ),
  'up' => 
  array (
    0 => 'class.intlcalendar.php',
    1 => 'IntlCalendar',
  ),
  'prev' => 
  array (
    0 => 'intlcalendar.getmaximum.php',
    1 => 'IntlCalendar::getMaximum',
  ),
  'next' => 
  array (
    0 => 'intlcalendar.getminimum.php',
    1 => 'IntlCalendar::getMinimum',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/intl/intlcalendar/getminimaldaysinfirstweek.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="intlcalendar.getminimaldaysinfirstweek" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlCalendar::getMinimalDaysInFirstWeek</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8, PECL &gt;= 3.0.0a1)</p><p class="refpurpose"><span class="refname">IntlCalendar::getMinimalDaysInFirstWeek</span> &mdash; <span class="dc-title">Get minimal number of days the first week in a year or month can have</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-intlcalendar.getminimaldaysinfirstweek-description">
  <h3 class="title">Description</h3>
  <p class="para">
   Object-oriented style
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>IntlCalendar::getMinimalDaysInFirstWeek</strong></span>(): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Procedural style
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>intlcal_get_minimal_days_in_first_week</strong></span>(<span class="methodparam"><span class="type"><a href="class.intlcalendar.php" class="type IntlCalendar">IntlCalendar</a></span> <code class="parameter">$calendar</code></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Returns the smallest number of days the first week of a year or month must
   have in the new year or month.  For instance, in the Gregorian calendar, if
   this value is 1, then the first week of the year will necessarily include
   January 1st, while if this value is 7, then the week with January 1st will
   be the first week of the year only if the day of the week for January 1st
   matches the day of the week returned by
   <span class="function"><a href="intlcalendar.getfirstdayofweek.php" class="function">IntlCalendar::getFirstDayOfWeek()</a></span>; otherwise it will be
   the previous yearʼs last week.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-intlcalendar.getminimaldaysinfirstweek-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">calendar</code></dt>
    <dd>
     <p class="para">An <span class="classname"><a href="class.intlcalendar.php" class="classname">IntlCalendar</a></span> instance.</p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-intlcalendar.getminimaldaysinfirstweek-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   An <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> representing a number of days or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>



 <div class="refsect1 examples" id="refsect1-intlcalendar.getminimaldaysinfirstweek-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>IntlCalendar::getMinimalDaysInFirstWeek()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'date.timezone'</span><span style="color: #007700">, </span><span style="color: #DD0000">'UTC'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">ini_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'intl.default_locale'</span><span style="color: #007700">, </span><span style="color: #DD0000">'en_US'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cal </span><span style="color: #007700">= new </span><span style="color: #0000BB">IntlGregorianCalendar</span><span style="color: #007700">(</span><span style="color: #0000BB">2013</span><span style="color: #007700">, </span><span style="color: #0000BB">0 </span><span style="color: #FF8000">/* January */</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">, </span><span style="color: #DD0000">'cccc'</span><span style="color: #007700">)); </span><span style="color: #FF8000">// Wednesday<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getMinimalDaysInFirstWeek</span><span style="color: #007700">(), </span><span style="color: #FF8000">// 1<br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFirstDayofWeek</span><span style="color: #007700">()); </span><span style="color: #FF8000">// 1 (Sunday)<br /><br />// Week 1 of 2013<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">, </span><span style="color: #DD0000">"'Week 'w' of 'Y"</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setMinimalDaysInFirstWeek</span><span style="color: #007700">(</span><span style="color: #0000BB">4</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// Still Week 1 of 2013 (1st week has 5 days in the new year)<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">, </span><span style="color: #DD0000">"'Week 'w' of 'Y"</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setMinimalDaysInFirstWeek</span><span style="color: #007700">(</span><span style="color: #0000BB">6</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// Week 53 of 2012<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">formatObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$cal</span><span style="color: #007700">, </span><span style="color: #DD0000">"'Week 'w' of 'Y"</span><span style="color: #007700">));</span></span></code></div>
    </div>

    <div class="example-contents"><p>The above example will output:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(9) &quot;Wednesday&quot;
int(1)
int(1)
string(14) &quot;Week 1 of 2013&quot;
string(14) &quot;Week 1 of 2013&quot;
string(15) &quot;Week 53 of 2012&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>



</div><?php manual_footer($setup); ?>