Nitroweb WordPress services
  • Home
  • Portfolio
  • About
  • Plugins
  • Services
  • News & Tutorials
  • Contact
  • Menu Menu
gravity forms date field tweak - no weekends and past dates

Remove weekends and past dates from Gravity Forms date field

May 11, 2026/0 Comments/in Tutorials/by nitroweb

Client needed to have weekends removed for the date field of the booking form on Gravity Forms.

Add this to your child’s theme function.php or snippet plugin.
Make sure you change the ID of the field. In the example below input_1_4 refers to form ID 1 and field ID 4.

Copy Code Copied Use a different Browser

add_action( 'wp_footer', function() {
    ?>
    <script>
    jQuery(document).ready(function($){

        setTimeout(function(){

           $('#input_1_4').datepicker(
				'option',
				{
					beforeShowDay: function(date) {
						var day = date.getDay();
						var today = new Date();
						today.setHours(0,0,0,0);

						if (date < today) return [false];
						if (day === 0 || day === 6) return [false];

						return [true];
					},
					minDate: 0
				}
			);

        }, 300);

    });
    </script>
    <?php
});

https://nitroweb.gr/wp-content/uploads/2026/05/gravity-forms-date-field-tweak.jpg 392 414 nitroweb https://nitroweb.gr/wp-content/uploads/2024/07/nitro-logo.png nitroweb2026-05-11 03:56:472026-05-11 04:05:57Remove weekends and past dates from Gravity Forms date field

How to override Elementor Essentials Addons template render output

October 25, 2025/0 Comments/in Tutorials/by nitroweb
Read more
https://nitroweb.gr/wp-content/uploads/2025/10/elementor-extra-section-field-01.jpg 697 366 nitroweb https://nitroweb.gr/wp-content/uploads/2024/07/nitro-logo.png nitroweb2025-10-25 16:57:552025-10-25 18:49:36How to override Elementor Essentials Addons template render output
Search Search

Recent Posts

  • Remove weekends and past dates from Gravity Forms date field
  • How to override Elementor Essentials Addons template render output

Categories

  • Tutorials
© Copyright - Nitroweb WordPress services
  • Link to X
  • Link to Facebook
Scroll to top Scroll to top Scroll to top