equal
deleted
inserted
replaced
26 |
26 |
27 /** |
27 /** |
28 * Minimum Year. |
28 * Minimum Year. |
29 * |
29 * |
30 * @since 4.9.0 |
30 * @since 4.9.0 |
31 * @var integer |
31 * @var int |
32 */ |
32 */ |
33 public $min_year = 1000; |
33 public $min_year = 1000; |
34 |
34 |
35 /** |
35 /** |
36 * Maximum Year. |
36 * Maximum Year. |
37 * |
37 * |
38 * @since 4.9.0 |
38 * @since 4.9.0 |
39 * @var integer |
39 * @var int |
40 */ |
40 */ |
41 public $max_year = 9999; |
41 public $max_year = 9999; |
42 |
42 |
43 /** |
43 /** |
44 * Allow past date, if set to false user can only select future date. |
44 * Allow past date, if set to false user can only select future date. |
45 * |
45 * |
46 * @since 4.9.0 |
46 * @since 4.9.0 |
47 * @var boolean |
47 * @var bool |
48 */ |
48 */ |
49 public $allow_past_date = true; |
49 public $allow_past_date = true; |
50 |
50 |
51 /** |
51 /** |
52 * Whether hours, minutes, and meridian should be shown. |
52 * Whether hours, minutes, and meridian should be shown. |
53 * |
53 * |
54 * @since 4.9.0 |
54 * @since 4.9.0 |
55 * @var boolean |
55 * @var bool |
56 */ |
56 */ |
57 public $include_time = true; |
57 public $include_time = true; |
58 |
58 |
59 /** |
59 /** |
60 * If set to false the control will appear in 24 hour format, |
60 * If set to false the control will appear in 24 hour format, |
61 * the value will still be saved in Y-m-d H:i:s format. |
61 * the value will still be saved in Y-m-d H:i:s format. |
62 * |
62 * |
63 * @since 4.9.0 |
63 * @since 4.9.0 |
64 * @var boolean |
64 * @var bool |
65 */ |
65 */ |
66 public $twelve_hour_format = true; |
66 public $twelve_hour_format = true; |
67 |
67 |
68 /** |
68 /** |
69 * Don't render the control's content - it's rendered with a JS template. |
69 * Don't render the control's content - it's rendered with a JS template. |
212 /** |
212 /** |
213 * Get timezone info. |
213 * Get timezone info. |
214 * |
214 * |
215 * @since 4.9.0 |
215 * @since 4.9.0 |
216 * |
216 * |
217 * @return array abbr and description. |
217 * @return array { |
|
218 * Timezone info. All properties are optional. |
|
219 * |
|
220 * @type string $abbr Timezone abbreviation. Examples: PST or CEST. |
|
221 * @type string $description Human-readable timezone description as HTML. |
|
222 * } |
218 */ |
223 */ |
219 public function get_timezone_info() { |
224 public function get_timezone_info() { |
220 $tz_string = get_option( 'timezone_string' ); |
225 $tz_string = get_option( 'timezone_string' ); |
221 $timezone_info = array(); |
226 $timezone_info = array(); |
222 |
227 |
223 if ( $tz_string ) { |
228 if ( $tz_string ) { |
224 try { |
229 try { |
225 $tz = new DateTimezone( $tz_string ); |
230 $tz = new DateTimeZone( $tz_string ); |
226 } catch ( Exception $e ) { |
231 } catch ( Exception $e ) { |
227 $tz = ''; |
232 $tz = ''; |
228 } |
233 } |
229 |
234 |
230 if ( $tz ) { |
235 if ( $tz ) { |