# GravityForm Form Restrictions - Schedule \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/gravityform-form-restrictions-schedule-resolved/4766>\
**Category:** Get Help\
**Tags:** gform\_get\_form\_filter, gravity-wiz\
**Created:** [May 11, 2020, 3:04am UTC](https://community.gravityforms.com/t/gravityform-form-restrictions-schedule-resolved/4766 "2020-05-11T03:04:34Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![user5eb5ede31e54a644](https://avatars.discourse-cdn.com/v4/letter/u/b5a626/32.png) [@user5eb5ede31e54a644](https://community.gravityforms.com/u/user5eb5ede31e54a644)\
**Post date:** [May 15, 2020, 3:54am UTC](https://community.gravityforms.com/t/gravityform-form-restrictions-schedule-resolved/4766/7 "2020-05-15T03:54:26Z")

</div>

I figured it out with additional code. Works like a charm.

```
add_filter( 'gform_get_form_filter_4', 'custom_schedule', 10, 2 );
function custom_schedule( $form_string, $form ) {
    $start = '07:00:00';
    $end = '19:00:00';
    $now = date("H:i:s");

    if($start < $end) {

	    // if current time is past start time or before end time

	    if($now <= $start || $now > $end){
		    $form_string = '<p>We are closed today, please return tomorrow to make your 
booking.</p>';
	    }
    }

    // else time frame is within same day check if we are between start and end

    else if ($now <= $start && $now >= $end) {
		    $form_string = '<p>We are closed today, please return tomorrow to make your 
booking.</p>';
    }

   return $form_string;
}
```

---

_[View the full topic](https://community.gravityforms.com/t/gravityform-form-restrictions-schedule-resolved/4766)._
