Hi Everyone. Trying to set up my app to only accept orders during opening hours.
In order to do this I want to hide my checkout button if the current time is not between the opening and closing hours.
If the checkout button is hidden then we will be able to see this message above letting the user now when it opens again.
To achieve this I used some advice from this forum to calculate time fractions.
So when the merchant sets up their opening/closing times I have this calculation:
Which provides me with the opening/closing time number fraction.
My Problem is when I calculate the current time fraction on my page. I get a different number as if I did it for the merchant.
If I calculate at 9am UK time I get
0.354166666667879 in the merchant date picker
0.32451388888876 calculating it from current time.
Can anyone help?