Code Duplication    Length = 12-12 lines in 2 locations

classes/fields/date.php 1 location

@@ 127-138 (lines=12) @@
124
		);
125
126
		// Check if PHP DateTime::createFromFormat exists for additional supported formats
127
		if ( method_exists( 'DateTime', 'createFromFormat' ) || apply_filters( 'pods_form_ui_field_datetime_custom_formatter', false ) ) {
128
			$options[ static::$type . '_format' ]['data'] = array_merge(
129
				$options[ static::$type . '_format' ]['data'], array(
130
					'dmy'      => date_i18n( 'd/m/Y' ),
131
					'dmy_dash' => date_i18n( 'd-m-Y' ),
132
					'dmy_dot'  => date_i18n( 'd.m.Y' ),
133
					'dMy'      => date_i18n( 'd/M/Y' ),
134
					'dMy_dash' => date_i18n( 'd-M-Y' ),
135
				)
136
			);
137
		}
138
139
		$options[ static::$type . '_format' ]['data']    = apply_filters( 'pods_form_ui_field_date_format_options', $options[ static::$type . '_format' ]['data'] );
140
		$options[ static::$type . '_format' ]['default'] = apply_filters( 'pods_form_ui_field_date_format_default', $options[ static::$type . '_format' ]['default'] );
141

classes/fields/datetime.php 1 location

@@ 197-208 (lines=12) @@
194
		);
195
196
		// Check if PHP DateTime::createFromFormat exists for additional supported formats
197
		if ( method_exists( 'DateTime', 'createFromFormat' ) || apply_filters( 'pods_form_ui_field_datetime_custom_formatter', false ) ) {
198
			$options[ static::$type . '_format' ]['data'] = array_merge(
199
				$options[ static::$type . '_format' ]['data'], array(
200
					'dmy'      => date_i18n( 'd/m/Y' ),
201
					'dmy_dash' => date_i18n( 'd-m-Y' ),
202
					'dmy_dot'  => date_i18n( 'd.m.Y' ),
203
					'dMy'      => date_i18n( 'd/M/Y' ),
204
					'dMy_dash' => date_i18n( 'd-M-Y' ),
205
				)
206
			);
207
		}
208
209
		$options[ static::$type . '_format' ]['data']    = apply_filters( 'pods_form_ui_field_date_format_options', $options[ static::$type . '_format' ]['data'] );
210
		$options[ static::$type . '_format' ]['default'] = apply_filters( 'pods_form_ui_field_date_format_default', $options[ static::$type . '_format' ]['default'] );
211