You need the formatDateTime function. In a microflow:
[day = $Day]
[open < $CurrentHour and closed > $CurrentHour]
If you get an object, the business is open. If not, the business is closed.
Hi Steven Preston
Instead of using enum create a entity with attributes day(String), from(DateTime), to(DateTime), create a over view pages for this entity. in add/edit page use date and time picker which is available in market place, don’t consider a date just select the time in that.
in your view page you can show only time.
for visibility there is a default option make use of it.
Thanks for your fast and expert reply!
I had to do some work to get to this point (ie. create the form to add the hours).
After some iterations, I ended up dropping the enums for day and open/close.
Created a AreOpen variable as false,
Created a loop to iterate through the list and set the AreOpen variable to true. (I am sure there is a better way, was looking for a object.length equivalent. If there is something like this short of Java, please let me know.) I have not tested this yet.
My next question is-
How do I conditionally show an element on a page?
I have a container with a layout grid inside. From there, content. I want to show this conditionally based upon a variable or other simple mechanism. (I was looking for a object.visible=visible equivalent.)
Essentially what I am trying to do is expose the call option during business hours only.
I did something similar but switched to the data grid to populate the table.
You did clear something up for me. I could not stich together in my mind how the date/time would really work in my scenario. The documentation states that it always stores a date/time even if the widget (I wanted to say object) is set to show time. I was not totally clear on that. While I did use the date/time widget for some tests, I was not feeling too confident that a time would actually be saved that would be easily reused. My mind goes immediately to simple. I have learned a valuable lesson here. I am grateful.
Mendix is really something. – Huh? I like it.