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