Code Duplication    Length = 12-12 lines in 2 locations

classes/fields/date.php 1 location

@@ 144-155 (lines=12) @@
141
		);
142
143
		// Check if PHP DateTime::createFromFormat exists for additional supported formats
144
		if ( method_exists( 'DateTime', 'createFromFormat' ) || apply_filters( 'pods_form_ui_field_datetime_custom_formatter', false ) ) {
145
			$options[ static::$type . '_format' ]['data'] = array_merge(
146
				$options[ static::$type . '_format' ]['data'], array(
147
					'dmy'      => date_i18n( 'd/m/Y' ),
148
					'dmy_dash' => date_i18n( 'd-m-Y' ),
149
					'dmy_dot'  => date_i18n( 'd.m.Y' ),
150
					'dMy'      => date_i18n( 'd/M/Y' ),
151
					'dMy_dash' => date_i18n( 'd-M-Y' ),
152
				)
153
			);
154
		}
155
156
		$options[ static::$type . '_format' ]['data']    = apply_filters( 'pods_form_ui_field_date_format_options', $options[ static::$type . '_format' ]['data'] );
157
		$options[ static::$type . '_format' ]['default'] = apply_filters( 'pods_form_ui_field_date_format_default', $options[ static::$type . '_format' ]['default'] );
158

classes/fields/datetime.php 1 location

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