JetTableAllClasses
Current view: C:\xampp\htdocs\table\jettable\JetDateFormatter.class.php
Date: Fri Dec 1 17:20:38 JST 2006 Executable lines: 8
Code covered: 100.00% Executed lines: 8
Legend: executed not executed dead code


       1                 : <?php                                                                             
       2                 : require_once "JetFormatter.class.php";                                            
       3                 :                                                                                   
       4                 : /**                                                                               
       5                 :  * 日付フォーマットクラス<br>                                                     
       6                 :  * 日付のフォーマットを操作するクラス                                             
       7                 :  *                                                                                
       8                 :  * @package    jettable.framework                                                 
       9                 :  * @author     rds <tk@rasign.jp>                                                 
      10                 :  * @license     http://www.opensource.org/licenses/mit-license.php The MIT License
      11                 :  * @version    $Revision: 1.2 $ $Date: 2006/11/30 13:54:29 $                      
      12                 :  * @link       http://jettable.rasign.jp/                                         
      13                 :  */                                                                               
      14                 : class JetDateFormatter extends JetFormatter{                                      
      15                 :                                                                                   
      16                 :     public function __construct($format = null){                                     
      17               2 :         parent::__construct($format);                                             
      18               2 :     }                                                                                
      19                 :                                                                                   
      20                 :     public function format($value){                                                  
      21               2 :         if(empty($value)){                                                              
      22               1 :             return null;                                                                   
      23                 :         }                                                                               
      24               2 :         if(empty($this->format)){                                                       
      25               1 :             return $value;                                                                 
      26                 :         }                                                                               
      27                 :                                                                                   
      28               2 :         $unixTimeStamp = strtotime($value);                                             
      29               2 :         return date($this->format, $unixTimeStamp);                                     
      30                 :     }                                                                                
      31                 : }                                                                                 
      32                 :                                                                                   
      33                 : ?>                                                                                

Generated by: PHPUnit 3.0.0 and Xdebug 2.0.0RC1.