Home / Admin / Adding French Time Format for the Date / Time field
Duplicate Snippet

Embed Snippet on Your Site

Adding French Time Format for the Date / Time field

This code snippet adds a new French format to the Date / Time field.

10+
Code Preview
php
<?php
/**
 * Add additional formats for the Time field Format dropdown using French time format.
 *
 * @link https://wpforms.com/developers/how-to-create-additional-formats-for-the-date-time-field-time-picker/
 */
function  wpf_dev_date_field_time_formats_french( $time_formats ) {
	$time_formats[ 'G\\\hi\\\m' ] = 'French Format';
	return $time_formats;
}
add_filter( 'wpforms_datetime_time_formats', 'wpf_dev_date_field_time_formats_french', 10, 1 );

Comments

Add a Comment