Prado\Util\TSimpleDateFormatter::getDayPattern PHP Метод

getDayPattern() публичный Метод

public getDayPattern ( )
    public function getDayPattern()
    {
        if (is_int(strpos($this->pattern, 'dd'))) {
            return 'dd';
        }
        if (is_int(strpos($this->pattern, 'd'))) {
            return 'd';
        }
        return false;
    }

Usage Example

Пример #1
0
 /**
  * @return array list of day options for a drop down list.
  */
 protected function getDropDownDayOptions()
 {
     $formatter = new TSimpleDateFormatter($this->getDateFormat());
     $days = array();
     $requiresPadding = $formatter->getDayPattern() === 'dd';
     for ($i = 1; $i <= 31; $i++) {
         $days[$i] = $requiresPadding ? str_pad($i, 2, '0', STR_PAD_LEFT) : $i;
     }
     return $days;
 }