Created
December 14, 2021 20:05
-
-
Save zackkatz/f23b4712f4ef0b6b9b66d89deed58efd to your computer and use it in GitHub Desktop.
GravityView Calendar - Set start day to be Monday
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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