ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Data\DateFormat\Factory Class Reference

Factory for Date Formats. More...

+ Collaboration diagram for ILIAS\Data\DateFormat\Factory:

Public Member Functions

 __construct (FormatBuilder $builder)
 
 standard ()
 Get the ISO 8601 date format (YYYY-MM-DD) More...
 
 custom ()
 Get the builder to define a custom DateFormat. More...
 
 amend (DateFormat $format)
 
 germanShort ()
 
 germanLong ()
 
 americanShort ()
 
 withTime12 (DateFormat $format)
 
 withTime24 (DateFormat $format)
 

Protected Attributes

FormatBuilder $builder
 

Detailed Description

Factory for Date Formats.

Definition at line 26 of file Factory.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Data\DateFormat\Factory::__construct ( FormatBuilder  $builder)

Definition at line 30 of file Factory.php.

31 {
32 $this->builder = $builder;
33 }

References ILIAS\Data\DateFormat\Factory\$builder.

Member Function Documentation

◆ amend()

ILIAS\Data\DateFormat\Factory::amend ( DateFormat  $format)

Definition at line 51 of file Factory.php.

51 : FormatBuilder
52 {
53 return $this->builder->initWithFormat($format);
54 }

References ILIAS\Data\DateFormat\FormatBuilder\initWithFormat().

Referenced by ILIAS\Data\DateFormat\Factory\withTime12(), and ILIAS\Data\DateFormat\Factory\withTime24().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ americanShort()

ILIAS\Data\DateFormat\Factory::americanShort ( )

Definition at line 67 of file Factory.php.

67 : DateFormat
68 {
69 return $this->builder->month()->slash()->day()->slash()->year()->get();
70 }

◆ custom()

ILIAS\Data\DateFormat\Factory::custom ( )

Get the builder to define a custom DateFormat.

Definition at line 46 of file Factory.php.

46 : FormatBuilder
47 {
48 return $this->builder;
49 }

References ILIAS\Data\DateFormat\Factory\$builder.

◆ germanLong()

ILIAS\Data\DateFormat\Factory::germanLong ( )

Definition at line 61 of file Factory.php.

61 : DateFormat
62 {
63 return $this->builder->weekday()->comma()->space()
64 ->day()->dot()->month()->dot()->year()->get();
65 }

◆ germanShort()

ILIAS\Data\DateFormat\Factory::germanShort ( )

Definition at line 56 of file Factory.php.

56 : DateFormat
57 {
58 return $this->builder->day()->dot()->month()->dot()->year()->get();
59 }

◆ standard()

ILIAS\Data\DateFormat\Factory::standard ( )

Get the ISO 8601 date format (YYYY-MM-DD)

Definition at line 38 of file Factory.php.

38 : DateFormat
39 {
40 return $this->builder->year()->dash()->month()->dash()->day()->get();
41 }

◆ withTime12()

ILIAS\Data\DateFormat\Factory::withTime12 ( DateFormat  $format)

Definition at line 72 of file Factory.php.

72 : DateFormat
73 {
74 return $this->amend($format)
75 ->space()->hours12()->colon()->minutes()->space()->meridiem()->get();
76 }
amend(DateFormat $format)
Definition: Factory.php:51

References ILIAS\Data\DateFormat\Factory\amend().

+ Here is the call graph for this function:

◆ withTime24()

ILIAS\Data\DateFormat\Factory::withTime24 ( DateFormat  $format)

Definition at line 78 of file Factory.php.

78 : DateFormat
79 {
80 return $this->amend($format)
81 ->space()->hours24()->colon()->minutes()->get();
82 }

References ILIAS\Data\DateFormat\Factory\amend().

+ Here is the call graph for this function:

Field Documentation

◆ $builder

FormatBuilder ILIAS\Data\DateFormat\Factory::$builder
protected

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