← API Index · How to use components

date component #oo-date

This component allows an authenticated user to select the next delivery date. It offers

One page can have only one date component. Still, some of the CSS classes listed below can be used throughout the page.

How components are mounted, how switch values are resolved and how debug output is enabled is described in the use-js-components skill.

<div id="oo-date" data-oo-shop-page="shop.html" data-oo-cart-page="cart.html"></div>

component switches

Page switches

Switch Default Description
oo-shop-page – Page hosting the main shop component. Conflict-free date selections switch to it; if not provided, the current page is not left. Also the last fallback for the new-order link (see oo-cart-neworderpage).
oo-cart-page – Page hosting the cart component. Target after selecting a date that already has an open order, and of the "go to cart" action in the change dialog.
oo-profile-page – Page hosting the profile component. Target of the delivery pause actions (opens the #pause section).
oo-cart-neworderpage – If the backend allows additional orders for an existing delivery day, this page is used after starting such an additional order. Falls back to oo-neworderpage, then oo-shop-page.
oo-neworderpage – Older name of oo-cart-neworderpage, still honoured as fallback.

Behaviour switches

Switch Default Description
oo-date-calendar true true renders the dates as a calendar, false as a plain date list.
oo-date-calendar-months 2 Number of months shown by the calendar. Only relevant with oo-date-calendar=true.

debug options

Debug scope date (enable with data-oo-debug="true" on the element or debug:date:<term>+, see the skill):

Term Description
date:all General debug output (resolved page targets, calendar mode, date list rendering, conflict handling).
date:cal Calendar rendering and delivery pause handling within the calendar.

States

State Description
pane Date list / calendar display (#oo-date-pane).
changedialog Asks if the user wants to store the current cart before changing to another date (.oo-date-changedialog). It has further sub-states depending on the cart situation: oo-date-changedialog-time and oo-date-changedialog-notime.

CSS tips