Date picker

Clicking the field opens a calendar below it.

Features

Usage

The calendar's HTML is in the component, not in the screen or the designer's page. The page provides only the CSS.

Picker month: shown day: one lang: lang open: (open = #from)
       pick: #pickFrom move: #showMonth toggle: #openFrom

pick:, move:, and toggle: take the names of the screen's handlers. Clicking a day sends pickFrom, paging the month sends showMonth, and clicking the field sends openFrom to the screen. The component does not know the screen's class.

For a date range, pass the range to highlight as well.

Picker month: shown day: to mark: from to: to
       lang: lang open: (open = #to)
       pick: #pickTo move: #showMonth toggle: #openTo

State is held by the screen

The component is not an actor and holds no state. The screen holds:

If the component were an actor, it could hold these, but it would then need to know the class of the screen to notify when a day is selected. That class differs between projects, so the component's type would change with each screen, and it could not be shared.