nyroFwk  0.2
Public Member Functions | Protected Member Functions | Protected Attributes
helper_date Class Reference
Inheritance diagram for helper_date:
object

Public Member Functions

 set ($date, $type='date', $len=null)
 
 getArray ()
 
 setArray (array $values)
 
 get ($part=null)
 
 format ($type=null, $len=null)
 
 formatDirect ($format)
 
 getJs ($default='""')
 
 timeago (helper_date $d=null)
 
 __toString ()
 
 getAttr ($name)
 
 setAttr ($name, $value)
 
 getCfg ()
 

Protected Member Functions

 afterinit ()
 
 beforeInit ()
 
 afterInit ()
 

Protected Attributes

 $timestamp
 
 $isNull = false
 
 $cfg
 

Detailed Description

Helper to deal with date

Definition at line 10 of file helper/date.class.php.

Member Function Documentation

◆ __toString()

__toString ( )

Definition at line 281 of file helper/date.class.php.

◆ afterinit()

afterinit ( )
protected

Definition at line 26 of file helper/date.class.php.

◆ afterInit()

afterInit ( )
protectedinherited

Call just after the configuration initialisation

Definition at line 40 of file object.class.php.

◆ beforeInit()

beforeInit ( )
protectedinherited

Call just before the configuration initialisation

Definition at line 35 of file object.class.php.

◆ format()

format (   $type = null,
  $len = null 
)

Format the date

Parameters
string$formatDate format (date, time, or datetime)
string$lenLength needed (short, medium, long, full, fullMed or mysql)
Returns
string The date formated

Definition at line 176 of file helper/date.class.php.

◆ formatDirect()

formatDirect (   $format)

Format the date directly by a string format

Parameters
string$formatDate format
Returns
string The date formated

Definition at line 204 of file helper/date.class.php.

◆ get()

get (   $part = null)

Get a date element

Parameters
sting$partDate type, could be any string used in the date PHP function
Returns
string|int

Definition at line 156 of file helper/date.class.php.

◆ getArray()

getArray ( )

Get an array describing the date

Returns
array

Definition at line 123 of file helper/date.class.php.

◆ getAttr()

getAttr (   $name)
inherited

Get an attribute

Parameters
string$nameAttribute name
Returns
mixed|null The attribute or null if not set

Definition at line 48 of file object.class.php.

◆ getCfg()

getCfg ( )
inherited

Get the configuration object

Returns
config

Definition at line 67 of file object.class.php.

◆ getJs()

getJs (   $default = '""')

Create a javascript code to create a new Date object

Parameters
string$defaultDefault string used in case of a non setted date
Returns
string the Javascript code

Definition at line 243 of file helper/date.class.php.

◆ set()

set (   $date,
  $type = 'date',
  $len = null 
)

Set a new date or a date element

Parameters
string | int$dateThe value to set
string$typeThe value type (timestamp, date, time or a key from getArray)

Definition at line 36 of file helper/date.class.php.

◆ setArray()

setArray ( array  $values)

Set a new date element with an array

Parameters
array$valuesNew values
See also
getArray

Definition at line 145 of file helper/date.class.php.

◆ setAttr()

setAttr (   $name,
  $value 
)
inherited

Set an attribute

Parameters
string$nameAttribute name
mixed$valueAttribute value

Definition at line 58 of file object.class.php.

◆ timeago()

timeago ( helper_date  $d = null)

Timeago in string to be shown

Parameters
helper_date | null$dDate to compare to or null to use the current time
Returns
string The timeago string

Definition at line 255 of file helper/date.class.php.

Field Documentation

◆ $cfg

$cfg
protectedinherited

Definition at line 17 of file object.class.php.

◆ $isNull

$isNull = false
protected

Definition at line 24 of file helper/date.class.php.

◆ $timestamp

$timestamp
protected

Definition at line 17 of file helper/date.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 2017 22:25:21 for nyroFwk by doxygen 1.8.13