FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Time.php
Go to the documentation of this file.
1 <?php
2 
4 
5 class Time extends Date{
6 
7  const DATE = 'date'; //!< Linked date element.
8 
9  public $date = null;
10 
11  public function clientConfig(){
12  return array_merge(parent::clientConfig(),[self::DATE => $this->date]);
13  }
14 
15  public function convert($value){
16  return $this->local->convertTime($value);
17  }
18 
19  public function format($value){
20  return $this->local->formatTime($value);
21  }
22 
23  public function checkFormat($value,$index = null){
24  return preg_match('/^(\\d+|\\d{1,2}:\\d{1,2}:\\d{1,2})$/',$value);
25  }
26 
27 }
const DATE
Linked date element.
Definition: Time.php:7
checkFormat($value, $index=null)
Definition: Time.php:23