ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilIndividualAssessmentDateFormatter Class Reference
+ Collaboration diagram for ilIndividualAssessmentDateFormatter:

Public Member Functions

 __construct (DataFactory $data_factory)
 
 getUserDateFormat (ilObjUser $user, bool $with_time=false)
 
 format (ilObjUser $user, DateTimeImmutable $datetime, bool $with_time=false)
 

Protected Attributes

DataFactory $data_factory
 

Detailed Description

Definition at line 24 of file ilIndividualAssessmentDateFormatter.php.

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentDateFormatter::__construct ( DataFactory  $data_factory)

Definition at line 28 of file ilIndividualAssessmentDateFormatter.php.

29 {
30 $this->data_factory = $data_factory;
31 }

References $data_factory.

Member Function Documentation

◆ format()

ilIndividualAssessmentDateFormatter::format ( ilObjUser  $user,
DateTimeImmutable  $datetime,
bool  $with_time = false 
)

Definition at line 50 of file ilIndividualAssessmentDateFormatter.php.

54 : string {
55 return $this->getUserDateFormat($user, $with_time)->applyTo($datetime);
56 }
$datetime
getUserDateFormat(ilObjUser $user, bool $with_time=false)

◆ getUserDateFormat()

ilIndividualAssessmentDateFormatter::getUserDateFormat ( ilObjUser  $user,
bool  $with_time = false 
)

Definition at line 33 of file ilIndividualAssessmentDateFormatter.php.

34 {
35 $df = $this->data_factory->dateFormat();
36 $date_format = $user->getDateFormat();
37 if ($with_time) {
38 switch ($user->getTimeFormat()) {
40 $date_format = $df->withTime12($date_format);
41 break;
43 default:
44 $date_format = $df->withTime24($date_format);
45 }
46 }
47 return $date_format;
48 }
A Date Format provides a format definition akin to PHP's date formatting options, but stores the sing...
Definition: DateFormat.php:27

References ilObjUser\getDateFormat(), ilObjUser\getTimeFormat(), ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

+ Here is the call graph for this function:

Field Documentation

◆ $data_factory

DataFactory ilIndividualAssessmentDateFormatter::$data_factory
protected

Definition at line 26 of file ilIndividualAssessmentDateFormatter.php.

Referenced by __construct().


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