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

@@ 294-298 (lines=5) @@
291
		$datetime = maybe_unserialize( $this->value );
292
		$this->value = $tzstring = '';
293
294
		if ( $datetime && $datetime instanceof DateTime ) {
295
			$tz       = $datetime->getTimezone();
296
			$tzstring = $tz->getName();
297
			$this->value    = $datetime->getTimestamp();
298
		}
299
300
		$date = $this->field->get_timestamp_format( 'date_format', $this->value );
301
		$time = $this->field->get_timestamp_format( 'time_format', $this->value );