Fakoli Framework
DateTypeRenderer Class Reference
+ Inheritance diagram for DateTypeRenderer:
+ Collaboration diagram for DateTypeRenderer:

Public Member Functions

 DateTypeRenderer ()
 
- Public Member Functions inherited from AbstractTypeRenderer
 AbstractTypeRenderer ()
 

Static Public Member Functions

static format ($date, $template="")
 
- Static Public Member Functions inherited from AbstractTypeRenderer
static format ($value, $template="")
 
static translationDateTemplate ($template, $includeTime=true)
 

Detailed Description

Definition at line 37 of file date_type_renderer.inc.

Member Function Documentation

◆ DateTypeRenderer()

DateTypeRenderer::DateTypeRenderer ( )

Definition at line 40 of file date_type_renderer.inc.

41  {
42  }

◆ format()

static DateTypeRenderer::format (   $date,
  $template = "" 
)
static

Definition at line 61 of file date_type_renderer.inc.

62  {
63  $text = "";
64 
65  if($date && !$template)
66  $template = "m/d/Y";
67  $template = AbstractTypeRenderer::translationDateTemplate($template, false);
68 
69  // Blank for zero dates
70  if (!strncmp("0000-00-00", $date, 10)) return "";
71 
72  if($date)
73  {
74  $dateObj = new DateTime($date);
75  $text = $dateObj->format($template);
76  }
77 
78  // return blank if no date
79  return $text;
80  }
static translationDateTemplate($template, $includeTime=true)

The documentation for this class was generated from the following file: