timepicker-ui
4.7.0GitHub
timepicker-ui
Basic Examples / Inline Calendar

Inline Calendar

Render the calendar permanently inside a page container with @pglejzer/datepicker-ui.

Inline

#

ui.inline.enabled renders the calendar into ui.inline.container, a selector or an element, instead of opening it. The input still holds the value. An inline picker has no footer by default, so it commits only through behavior.commitOnChange or behavior.closeOnSelect.

index.html
<input id="date" />
<div id="calendar"></div>
Inline
import { DatepickerUI } from "@pglejzer/datepicker-ui";
import "@pglejzer/datepicker-ui/index.css";
new DatepickerUI("#date", {
ui: { inline: { enabled: true, container: "#calendar" } },
behavior: { commitOnChange: true },
}).create();
#

An inline calendar has the docked look by default. ui.layout: "modal" gives it the headline, a month row with arrows and month and year grids. "fullscreen" does the same for a single picker and gives a range picker the full-screen layout.

Inline modal look
import { DatepickerUI } from "@pglejzer/datepicker-ui";
import "@pglejzer/datepicker-ui/index.css";
new DatepickerUI("#date", {
ui: { layout: "modal", inline: { enabled: true, container: "#calendar" } },
behavior: { commitOnChange: true },
}).create();
#

ui.footer: true shows the footer in inline mode. The user then confirms with the OK button and the picker commits nothing before that, so commitOnChange is not needed.

Inline footer
import { DatepickerUI } from "@pglejzer/datepicker-ui";
import "@pglejzer/datepicker-ui/index.css";
new DatepickerUI("#date", {
ui: { inline: { enabled: true, container: "#calendar" }, footer: true },
}).create();

Docs: Display Modes · Layouts

Esc