MediaWiki REL1_39
TimezoneFilter.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Preferences;
22
24
25class TimezoneFilter implements Filter {
26
30 public function filterForForm( $value ) {
31 return $value;
32 }
33
37 public function filterFromForm( $tz ) {
38 if ( $tz === UserTimeCorrection::SYSTEM ) {
39 return $tz;
40 }
41 return ( new UserTimeCorrection( $tz ) )->toString();
42 }
43}
Utility class to parse the TimeCorrection string value.
Base interface for user preference filters that work as a middleware between storage and interface.
Definition Filter.php:27