Code Duplication    Length = 5-5 lines in 2 locations

includes/types/CMB2_Type_Text_Datetime_Timestamp_Timezone.php 1 location

@@ 33-37 (lines=5) @@
30
		$datetime = maybe_unserialize( $args['value'] );
31
		$value = $tzstring = '';
32
33
		if ( $datetime && $datetime instanceof DateTime ) {
34
			$tz       = $datetime->getTimezone();
35
			$tzstring = $tz->getName();
36
			$value    = $datetime->getTimestamp();
37
		}
38
39
		$timestamp_args = wp_parse_args( $args['text_datetime_timestamp'], array(
40
			'desc'     => '',

includes/CMB2_Field_Display.php 1 location

@@ 307-311 (lines=5) @@
304
		$datetime = maybe_unserialize( $this->value );
305
		$this->value = $tzstring = '';
306
307
		if ( $datetime && $datetime instanceof DateTime ) {
308
			$tz       = $datetime->getTimezone();
309
			$tzstring = $tz->getName();
310
			$this->value    = $datetime->getTimestamp();
311
		}
312
313
		$date = $this->field->get_timestamp_format( 'date_format', $this->value );
314
		$time = $this->field->get_timestamp_format( 'time_format', $this->value );