本文整理汇总了PHP中DateHelper::select_day方法的典型用法代码示例。如果您正苦于以下问题:PHP DateHelper::select_day方法的具体用法?PHP DateHelper::select_day怎么用?PHP DateHelper::select_day使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateHelper
的用法示例。
在下文中一共展示了DateHelper::select_day方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_DateHelper
//.........这里部分代码省略.........
<option value="33">33</option>
<option value="34">34</option>
<option value="35">35</option>
<option value="36">36</option>
<option value="37" selected="selected">37</option>
<option value="38">38</option>
<option value="39">39</option>
<option value="40">40</option>
<option value="41">41</option>
<option value="42">42</option>
<option value="43">43</option>
<option value="44">44</option>
<option value="45">45</option>
<option value="46">46</option>
<option value="47">47</option>
<option value="48">48</option>
<option value="49">49</option>
<option value="50">50</option>
<option value="51">51</option>
<option value="52">52</option>
<option value="53">53</option>
<option value="54">54</option>
<option value="55">55</option>
<option value="56">56</option>
<option value="57">57</option>
<option value="58">58</option>
<option value="59">59</option>
</select>'), array(''))));
//$ActiveRecord->tally();
$date = '1978-06-16 12:20:30';
$this->assertEqual(join(array_diff(explode("\n", DateHelper::select_datetime($date) . DateHelper::select_date($date) . DateHelper::select_time($date) . DateHelper::select_second($date) . DateHelper::select_minute($date) . DateHelper::select_hour($date) . DateHelper::select_day($date) . DateHelper::select_month($date) . DateHelper::select_year($date)), array(''))), join(array_diff(explode("\n", '<select name="dateyear">
<option value="1973">1973</option>
<option value="1974">1974</option>
<option value="1975">1975</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978" selected="selected">1978</option>
<option value="1979">1979</option>
<option value="1980">1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
</select>
<select name="datemonth">
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June" selected="selected">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
<select name="dateday">
<option value="1">1</option>
<option value="2">2</option>
示例2: select_datetime
/**
* Returns a set of html select-tags (one for year, month, day, hour, and minute) pre-selected with the +datetime+.
*/
function select_datetime($datetime = null, $options = array())
{
$datetime = empty($datetime) ? Ak::getDate() : $datetime;
return DateHelper::select_year($datetime, $options) . DateHelper::select_month($datetime, $options) . DateHelper::select_day($datetime, $options) . DateHelper::select_hour($datetime, $options) . DateHelper::select_minute($datetime, $options);
}
示例3: to_date_tag
function to_date_tag()
{
require_once AK_LIB_DIR . DS . 'AkActionView' . DS . 'helpers' . DS . 'date_helper.php';
$defaults = $this->default_date_options;
$date = $this->getValue();
$date = !empty($date) ? $date : Ak::getDate();
return DateHelper::select_day($date, array_merge($defaults, array('prefix' => "{$this->object_name}[{$this->_column_name}(3)]"))) . DateHelper::select_month($date, array_merge($defaults, array('prefix' => "{$this->object_name}[{$this->_column_name}(2)]"))) . DateHelper::select_year($date, array_merge($defaults, array('prefix' => "{$this->object_name}[{$this->_column_name}(1)]")));
}
示例4: testSelect_day_method
/**
* Test select_day() method
*
* Test {@link DateHelper::select_day()}
*/
public function testSelect_day_method()
{
$dh = new DateHelper();
// Test generation with all arguments omitted
$this->assertContains('selected="selected">' . date('d'), $dh->select_day());
// Test generation with twelfth selected, default format
$this->assertEquals('<select name="day">' . "\n" . '<option value="01">01</option>' . "\n" . '<option value="02">02</option>' . "\n" . '<option value="03">03</option>' . "\n" . '<option value="04">04</option>' . "\n" . '<option value="05">05</option>' . "\n" . '<option value="06">06</option>' . "\n" . '<option value="07">07</option>' . "\n" . '<option value="08">08</option>' . "\n" . '<option value="09">09</option>' . "\n" . '<option value="10">10</option>' . "\n" . '<option value="11">11</option>' . "\n" . '<option value="12" selected="selected">12</option>' . "\n" . '<option value="13">13</option>' . "\n" . '<option value="14">14</option>' . "\n" . '<option value="15">15</option>' . "\n" . '<option value="16">16</option>' . "\n" . '<option value="17">17</option>' . "\n" . '<option value="18">18</option>' . "\n" . '<option value="19">19</option>' . "\n" . '<option value="20">20</option>' . "\n" . '<option value="21">21</option>' . "\n" . '<option value="22">22</option>' . "\n" . '<option value="23">23</option>' . "\n" . '<option value="24">24</option>' . "\n" . '<option value="25">25</option>' . "\n" . '<option value="26">26</option>' . "\n" . '<option value="27">27</option>' . "\n" . '<option value="28">28</option>' . "\n" . '<option value="29">29</option>' . "\n" . '<option value="30">30</option>' . "\n" . '<option value="31">31</option>' . "\n" . '</select>' . "\n", $dh->select_day('12'));
// Test generation with English selection, default format
$this->assertEquals('<select name="day">' . "\n" . '<option value="01">01</option>' . "\n" . '<option value="02">02</option>' . "\n" . '<option value="03">03</option>' . "\n" . '<option value="04">04</option>' . "\n" . '<option value="05">05</option>' . "\n" . '<option value="06">06</option>' . "\n" . '<option value="07">07</option>' . "\n" . '<option value="08">08</option>' . "\n" . '<option value="09">09</option>' . "\n" . '<option value="10">10</option>' . "\n" . '<option value="11">11</option>' . "\n" . '<option value="12">12</option>' . "\n" . '<option value="13">13</option>' . "\n" . '<option value="14">14</option>' . "\n" . '<option value="15">15</option>' . "\n" . '<option value="16">16</option>' . "\n" . '<option value="17">17</option>' . "\n" . '<option value="18">18</option>' . "\n" . '<option value="19">19</option>' . "\n" . '<option value="20">20</option>' . "\n" . '<option value="21">21</option>' . "\n" . '<option value="22">22</option>' . "\n" . '<option value="23">23</option>' . "\n" . '<option value="24">24</option>' . "\n" . '<option value="25" selected="selected">25</option>' . "\n" . '<option value="26">26</option>' . "\n" . '<option value="27">27</option>' . "\n" . '<option value="28">28</option>' . "\n" . '<option value="29">29</option>' . "\n" . '<option value="30">30</option>' . "\n" . '<option value="31">31</option>' . "\n" . '</select>' . "\n", $dh->select_day('25 December 2002'));
// Test generation with twentieth selected, name change
$this->assertEquals('<select name="new-day">' . "\n" . '<option value="01">01</option>' . "\n" . '<option value="02">02</option>' . "\n" . '<option value="03">03</option>' . "\n" . '<option value="04">04</option>' . "\n" . '<option value="05">05</option>' . "\n" . '<option value="06">06</option>' . "\n" . '<option value="07">07</option>' . "\n" . '<option value="08">08</option>' . "\n" . '<option value="09">09</option>' . "\n" . '<option value="10">10</option>' . "\n" . '<option value="11">11</option>' . "\n" . '<option value="12">12</option>' . "\n" . '<option value="13">13</option>' . "\n" . '<option value="14">14</option>' . "\n" . '<option value="15">15</option>' . "\n" . '<option value="16">16</option>' . "\n" . '<option value="17">17</option>' . "\n" . '<option value="18">18</option>' . "\n" . '<option value="19">19</option>' . "\n" . '<option value="20" selected="selected">20</option>' . "\n" . '<option value="21">21</option>' . "\n" . '<option value="22">22</option>' . "\n" . '<option value="23">23</option>' . "\n" . '<option value="24">24</option>' . "\n" . '<option value="25">25</option>' . "\n" . '<option value="26">26</option>' . "\n" . '<option value="27">27</option>' . "\n" . '<option value="28">28</option>' . "\n" . '<option value="29">29</option>' . "\n" . '<option value="30">30</option>' . "\n" . '<option value="31">31</option>' . "\n" . '</select>' . "\n", $dh->select_day('20', array('field_name' => 'new-day')));
// Test generation with thirtieth selected, include blank
$this->assertEquals('<select name="day">' . "\n" . '<option value=""></option>' . "\n" . '<option value="01">01</option>' . "\n" . '<option value="02">02</option>' . "\n" . '<option value="03">03</option>' . "\n" . '<option value="04">04</option>' . "\n" . '<option value="05">05</option>' . "\n" . '<option value="06">06</option>' . "\n" . '<option value="07">07</option>' . "\n" . '<option value="08">08</option>' . "\n" . '<option value="09">09</option>' . "\n" . '<option value="10">10</option>' . "\n" . '<option value="11">11</option>' . "\n" . '<option value="12">12</option>' . "\n" . '<option value="13">13</option>' . "\n" . '<option value="14">14</option>' . "\n" . '<option value="15">15</option>' . "\n" . '<option value="16">16</option>' . "\n" . '<option value="17">17</option>' . "\n" . '<option value="18">18</option>' . "\n" . '<option value="19">19</option>' . "\n" . '<option value="20">20</option>' . "\n" . '<option value="21">21</option>' . "\n" . '<option value="22">22</option>' . "\n" . '<option value="23">23</option>' . "\n" . '<option value="24">24</option>' . "\n" . '<option value="25">25</option>' . "\n" . '<option value="26">26</option>' . "\n" . '<option value="27">27</option>' . "\n" . '<option value="28">28</option>' . "\n" . '<option value="29">29</option>' . "\n" . '<option value="30" selected="selected">30</option>' . "\n" . '<option value="31">31</option>' . "\n" . '</select>' . "\n", $dh->select_day('30', array('include_blank' => true)));
// Test override of day argument
// Simulate fifth parsed from $_REQUEST
$dh->attribute_name = 'someday';
$dh->request_days = array('someday' => '05');
// Test generation with twelfth selected, default format
$this->assertEquals('<select name="day">' . "\n" . '<option value="01">01</option>' . "\n" . '<option value="02">02</option>' . "\n" . '<option value="03">03</option>' . "\n" . '<option value="04">04</option>' . "\n" . '<option value="05" selected="selected">05</option>' . "\n" . '<option value="06">06</option>' . "\n" . '<option value="07">07</option>' . "\n" . '<option value="08">08</option>' . "\n" . '<option value="09">09</option>' . "\n" . '<option value="10">10</option>' . "\n" . '<option value="11">11</option>' . "\n" . '<option value="12">12</option>' . "\n" . '<option value="13">13</option>' . "\n" . '<option value="14">14</option>' . "\n" . '<option value="15">15</option>' . "\n" . '<option value="16">16</option>' . "\n" . '<option value="17">17</option>' . "\n" . '<option value="18">18</option>' . "\n" . '<option value="19">19</option>' . "\n" . '<option value="20">20</option>' . "\n" . '<option value="21">21</option>' . "\n" . '<option value="22">22</option>' . "\n" . '<option value="23">23</option>' . "\n" . '<option value="24">24</option>' . "\n" . '<option value="25">25</option>' . "\n" . '<option value="26">26</option>' . "\n" . '<option value="27">27</option>' . "\n" . '<option value="28">28</option>' . "\n" . '<option value="29">29</option>' . "\n" . '<option value="30">30</option>' . "\n" . '<option value="31">31</option>' . "\n" . '</select>' . "\n", $dh->select_day('12'));
}
示例5: test_should_select_prompted_text
public function test_should_select_prompted_text()
{
$this->assertEqual(DateHelper::select_year(null, array('prefix' => 'event_date_', 'prompt' => '-- Select --', 'start_year' => 2008, 'end_year' => 2011)), file_get_contents(HelperUnitTest::getFixturesDir() . DS . 'date_helper_select_year_with_prompt.txt'));
$this->assertEqual(DateHelper::select_month(null, array('prefix' => 'event_date_', 'prompt' => '-- Select --')), file_get_contents(HelperUnitTest::getFixturesDir() . DS . 'date_helper_select_month_with_prompt.txt'));
$this->assertEqual(DateHelper::select_day('', array('prefix' => 'event_date_', 'prompt' => '-- Select --')), file_get_contents(HelperUnitTest::getFixturesDir() . DS . 'date_helper_select_day_with_prompt.txt'));
}
示例6: test_select_day
function test_select_day()
{
$this->assertEqual(DateHelper::select_day($this->date), file_get_contents(AK_TEST_HELPERS_DIR . DS . 'date_helper_select_day.txt'));
}
示例7: test_should_select_prompted_text
function test_should_select_prompted_text()
{
$this->assertEqual(DateHelper::select_year(null, array('prefix'=>'event_date_', 'prompt'=>'-- Select --', 'start_year'=>2008, 'end_year'=>2011)), file_get_contents(AK_TEST_HELPERS_DIR.DS.'date_helper_select_year_with_prompt.txt'));
$this->assertEqual(DateHelper::select_month(null, array('prefix'=>'event_date_', 'prompt'=>'-- Select --')), file_get_contents(AK_TEST_HELPERS_DIR.DS.'date_helper_select_month_with_prompt.txt'));
$this->assertEqual(DateHelper::select_day('', array('prefix'=>'event_date_', 'prompt'=>'-- Select --')), file_get_contents(AK_TEST_HELPERS_DIR.DS.'date_helper_select_day_with_prompt.txt'));
}