Skip to content

Instantly share code, notes, and snippets.

@kenmasters
Last active January 27, 2023 04:39
Show Gist options
  • Save kenmasters/4cdf592f5486432d7fb453a9ba86e3a9 to your computer and use it in GitHub Desktop.
Save kenmasters/4cdf592f5486432d7fb453a9ba86e3a9 to your computer and use it in GitHub Desktop.
GravityForms Display month name instead of numbers 1-12
/**
* NOTE: This is a jQuery code used withing Blunova websites {GetAJob|CB|Docreko|OrderPayroll...}
* Place this code inside WP active themes js folder
*/
/**
* Tweak for Gravity Forms month name
* This will target all instance of date field month dropdown
*/
let select_month_options =$('.gfield_date_dropdown_month select option');
let month_names = [ '', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
$.each( select_month_options, function( key, option ) {
let value = option.value;
if ( '' !== value ) {
option.label = month_names[value];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment