1 | <?php |
||
19 | class TimeFormatter extends ValueFormatterBase { |
||
20 | |||
21 | /** |
||
22 | * @deprecated since 0.7.1, use TimeValue::CALENDAR_GREGORIAN instead |
||
23 | */ |
||
24 | const CALENDAR_GREGORIAN = TimeValue::CALENDAR_GREGORIAN; |
||
25 | |||
26 | /** |
||
27 | * @deprecated since 0.7.1, use TimeValue::CALENDAR_JULIAN instead |
||
28 | */ |
||
29 | const CALENDAR_JULIAN = TimeValue::CALENDAR_JULIAN; |
||
30 | |||
31 | /** |
||
32 | * Option to localize calendar models. Must contain an array mapping known calendar model URIs |
||
33 | * to localized calendar model names. |
||
34 | */ |
||
35 | const OPT_CALENDARNAMES = 'calendars'; |
||
36 | |||
37 | /** |
||
38 | * Option for a custom timestamp formatter. Must contain an instance of a ValueFormatter |
||
39 | * subclass, capable of formatting TimeValue objects. The output of the custom formatter is |
||
40 | * threaded as plain text and passed through. |
||
41 | */ |
||
42 | const OPT_TIME_ISO_FORMATTER = 'time iso formatter'; |
||
43 | |||
44 | /** |
||
45 | * @see ValueFormatterBase::__construct |
||
46 | * |
||
47 | * @param FormatterOptions|null $options |
||
48 | */ |
||
49 | public function __construct( FormatterOptions $options = null ) { |
||
59 | |||
60 | /** |
||
61 | * @see ValueFormatter::format |
||
62 | * |
||
63 | * @param TimeValue $value |
||
64 | * |
||
65 | * @throws InvalidArgumentException |
||
66 | * @return string Plain text |
||
67 | */ |
||
68 | public function format( $value ) { |
||
78 | |||
79 | /** |
||
80 | * @param TimeValue $value |
||
81 | * |
||
82 | * @return string Plain text |
||
83 | */ |
||
84 | private function getFormattedTimestamp( TimeValue $value ) { |
||
140 | |||
141 | /** |
||
142 | * @param string $calendarModel |
||
143 | * |
||
144 | * @return string Plain text |
||
145 | */ |
||
146 | private function getFormattedCalendarModel( $calendarModel ) { |
||
155 | |||
156 | } |
||
157 |