• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Block datefield today if time is 13:00 - 0.00

Block datefield today if time is 13:00 - 0.00 4 years 3 months ago #40929

  • jan007
  • jan007's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Hi!

I made a restaurant order form for home delivery. Orders before 13:00 hours can be delivered the same day.

In the date field, you can block dates (eg dates before today). But what I need is to block today when the time is 13:00 - 0:00 hours.

Is there any way to do this?
Last Edit: 4 years 3 months ago by jan007.
The administrator has disabled public write access.

Block date and time 4 years 3 months ago #40932

  • jan007
  • jan007's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Thank you received: 1
Solved!!

I duplicated the form.

In the datefield of the form:
In 1 form dates are blocked which are in the past. In form 2 dates are blocked incl today.

form1
//<code>
return date('m/d/Y');
//</code>

form2
//<code>
$currentdate = date('m/d/Y');
return date('m/d/Y', strtotime($currentdate. ' + 1 days'));
//</code>

Java script is added to form 1:

<script type="text/javascript">
var hours = new Date().getHours();
if(hours >= 13){
window.location.href = "/link-form2";
}
</script>
Last Edit: 4 years 3 months ago by jan007.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!