Follow

cml:hours- Hours of Operation Input Tool

cml:hours

Renders a widget for inputting hours of operation for every day of the week. Accepts all common attributes except for value and default.

<cml:hours label="When is this business open?" allowunlisted="true" />

Note that cml:hours is always required. If you do not want the field to be required, use CML Logic to hide the field if the contributor does not need to input anything.

Additional attributes

allowunlisted

If set to "true", the hours dropdowns will include a "Not listed" option that will allow contributors to specify that the hours of operation were not listed for that given day. Defaults to "false". (optional)

 

Returned columns

cml:hours returns the following columns for each day of the week (mon, tue,wed, thu, fri, sat, sun):

  • {field_name}_{day}_openallday - "TRUE" if the contributor selected "Open all day", "FALSE" otherwise.
  • {field_name}_{day}_closedallday - "TRUE" if the contributor selected "Closed all day", "FALSE" otherwise.
  • {field_name}_{day}_open_1 - The first open time. One of several values:
    • "" - Nothing is submitted if the contributor chose "Open all day" or "Closed all day"
    • "not_listed" - If allowunlisted is set to "true", contributors will have the option of selecting a "Not listed" option. This is the value that is submitted when this occurs.
    • "##:##" - A time is submitted in 24-hour format. For example: "17:30" (5:30pm)
  • {field_name}_{day}_close_1 - The first close time. Same potential output values as the first open time.
  • {field_name}_{day}_open_2 - The second open time. Will be blank unless the contributor clicked "Add extra time range". Same potential output values as the first open time.
  • {field_name}_{day}_close_2 - The second close time. Will be blank unless the contributor clicked "Add extra time range". Same potential output values as the first open time.

Was this article helpful?
0 out of 0 found this helpful


Have more questions? Submit a request
Powered by Zendesk