Last active
November 12, 2018 18:34
Revisions
-
superpowered revised this gist
Nov 12, 2018 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,15 +3,15 @@ jQuery(document).on('gform_post_render', function($) { //#input_[form_id]_[field_id] //Get Date Field Input var $dateField = jQuery( "#input_16_6" ); var date = new Date($dateField.val()); //Get Weekday Time Dropdown fields var $mondayTimes = jQuery( "#field_16_7" ); var $tuesdayTimes = jQuery( "#field_16_8" ); var $wednesdayTimes = jQuery( "#field_16_9" ); var $thursdayTimes = jQuery( "#field_16_10" ); var $fridayTimes = jQuery( "#field_16_11" ); //Store in array var weekdayTimes = ['sunday',$mondayTimes,$tuesdayTimes,$wednesdayTimes,$thursdayTimes,$fridayTimes,'saturday']; @@ -38,7 +38,7 @@ jQuery(document).on('gform_post_render', function($) $dateField.on('change', function() { //Update our date date = new Date(jQuery(this).val()); showDropdowns(date.getDay()); }); -
superpowered revised this gist
Nov 12, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ //Note that this does NOT validate server side. jQuery(document).on('gform_post_render', function($) { //#input_[form_id]_[field_id] //Get Date Field Input @@ -18,7 +18,7 @@ jQuery(document).ready(function($) //Disable Weekends on date $dateField .datepicker({ "beforeShowDay": jQuery.datepicker.noWeekends, "dateFormat":"mm/dd/yy"}); //Hide all dropdowns other than one specified function showDropdowns(index) -
superpowered revised this gist
Nov 12, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ jQuery(document).ready(function($) //Disable Weekends on date $dateField .datepicker({ "beforeShowDay": jQuery.datepicker.noWeekends, "closeText":"Close","currentText":"Today","monthNames":["January","February","March","April","May","June","July","August","September","October","November","December"],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"nextText":"Next","prevText":"Previous","dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"dayNamesMin":["S","M","T","W","T","F","S"],"dateFormat":"MM d, yy","firstDay":1,"isRTL":false }); //Hide all dropdowns other than one specified function showDropdowns(index) -
superpowered revised this gist
Nov 12, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -32,14 +32,14 @@ jQuery(document).ready(function($) } //Hide all dropdowns by default showDropdowns(date.getDay()); //"Fake" Conditional Logic $dateField.on('change', function() { //Update our date date = new Date($(this).val()); showDropdowns(date.getDay()); }); }); -
superpowered revised this gist
Nov 12, 2018 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,16 +2,16 @@ jQuery(document).ready(function($) { //#input_[form_id]_[field_id] //Get Date Field Input var $dateField = $( "#input_16_6" ); var date = new Date($dateField.val()); //Get Weekday Time Dropdown fields var $mondayTimes = $( "#field_16_7" ); var $tuesdayTimes = $( "#field_16_8" ); var $wednesdayTimes = $( "#field_16_9" ); var $thursdayTimes = $( "#field_16_10" ); var $fridayTimes = $( "#field_16_11" ); //Store in array var weekdayTimes = ['sunday',$mondayTimes,$tuesdayTimes,$wednesdayTimes,$thursdayTimes,$fridayTimes,'saturday']; -
superpowered revised this gist
Nov 12, 2018 . 1 changed file with 43 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,45 @@ //Note that this does NOT validate server side. jQuery(document).ready(function($) { //#input_[form_id]_[field_id] //Get Date Field var $dateField = $( "#input_16_6" ); var date = new Date($dateField.val()); //Get Weekday Time Dropdowns var $mondayTimes = $( "#input_16_7" ); var $tuesdayTimes = $( "#input_16_8" ); var $wednesdayTimes = $( "#input_16_9" ); var $thursdayTimes = $( "#input_16_10" ); var $fridayTimes = $( "#input_16_11" ); //Store in array var weekdayTimes = ['sunday',$mondayTimes,$tuesdayTimes,$wednesdayTimes,$thursdayTimes,$fridayTimes,'saturday']; //Disable Weekends on date $dateField .datepicker({ gotoCurrent: true, prevText: '<', nextText: '>', showOn: 'both', beforeShowDay: jQuery.datepicker.noWeekends }); //Hide all dropdowns other than one specified function showDropdowns(index) { for(var x = 1; x < weekdayTimes.length - 1; x++) { weekdayTimes[x].hide(); } if(index && index !== 6) weekdayTimes[index].show(); } //Hide all dropdowns by default showDropdowns(date); //"Fake" Conditional Logic $dateField.on('change', function() { //Update our date date = new Date($(this).val()); showDropdowns(date); }); }); -
superpowered created this gist
Nov 12, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ //Note that this does not validate server side. jQuery(document).ready(function($) { $( "#input_16_6" ) //#input_[form_id]_[field_id] .datepicker({ gotoCurrent: true, prevText: '<', nextText: '>', showOn: 'both', beforeShowDay: jQuery.datepicker.noWeekends }); });