Last active
January 27, 2023 04:39
-
-
Save kenmasters/4cdf592f5486432d7fb453a9ba86e3a9 to your computer and use it in GitHub Desktop.
GravityForms Display month name instead of numbers 1-12
This file contains hidden or 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
/** | |
* 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