Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zackkatz
Created December 14, 2021 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackkatz/f23b4712f4ef0b6b9b66d89deed58efd to your computer and use it in GitHub Desktop.
Save zackkatz/f23b4712f4ef0b6b9b66d89deed58efd to your computer and use it in GitHub Desktop.
GravityView Calendar - Set start day to be Monday
<?php
/**
* Change the start day to something other than the WordPress settings.
*
* The value must be a number that represents the day of the week.
* Sunday=0, Monday=1, Tuesday=2, etc.
*
* @param array $calendar_options Calendar options
* @param int $form_id Form ID
* @param int $feed_id Calendar feed ID
*/
add_filter( 'gravityview/calendar/options', function( $calendar_options, $form_id, $feed_id ) {
// Set the calendar week to start on Monday
$calendar_options['firstDay'] = 1;
return $calendar_options;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment