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

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