Skip to content

Instantly share code, notes, and snippets.

@aimahdi
Created February 10, 2022 06:56
Show Gist options
  • Save aimahdi/ffcd1d006485eeb79868a6cc13d962fc to your computer and use it in GitHub Desktop.
Save aimahdi/ffcd1d006485eeb79868a6cc13d962fc to your computer and use it in GitHub Desktop.
// add extra settings to flatpickr calendar
function bleye_ff_custom_calendar_settings( $config, $settings, $form ) {
$start_of_week = get_option('start_of_week'); // get the option from the WP settings
$config['locale'] = ['firstDayOfWeek' => $start_of_week]; // add the config to flatpickr
return $config;
}
add_filter('fluentform/frontend_date_format', 'bleye_ff_custom_calendar_settings', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment