Skip to content
v0.9.1
Forms

Date range

Pick a start and an end date: for reports, bookings, filters and time off. Put two date fields in .daterange with data-momo-daterange. They stay in the form; momo.js turns them into one button with quick ranges and two months side by side. Without JavaScript the two date fields still work.

Basic

Click a start day, then an end day (the range follows your pointer in between), then Apply. A quick range applies right away. Clicking outside, Esc or leaving with Tab closes it without changes.

<div class="form-field">
  <label class="form-label" for="dr-report">Report period</label>
  <div class="daterange" data-momo-daterange>
    <input type="date" id="dr-report" name="from" value="2026-11-02" aria-label="Start date">
    <input type="date" name="to" value="2026-11-15" aria-label="End date">
  </div>
</div>

Keyboard

KeyDoes
↓ on the buttonOpens it on the start day
ArrowsMove a day or a week (the range follows while you pick the end)
Home / EndStart or end of the week
PgUp / PgDnA month back or forward (with Shift: a year)
Enter / SpacePicks the day
EscCloses without changes

Limits and no quick ranges

min and max on the first field cross out the days you cannot pick. data-presets="none" hides the quick ranges, or list the ones you want: today, yesterday, 7d, 30d, month, lastmonth, year. data-placeholder sets the empty text.

Bookings open from 20 Nov.

<div class="form-field">
  <label class="form-label" for="dr-trip">Trip dates</label>
  <div class="daterange" data-momo-daterange data-presets="none" data-placeholder="Check in - check out">
    <input type="date" id="dr-trip" name="checkin" min="2026-11-20" max="2027-03-31" aria-label="Check in">
    <input type="date" name="checkout" aria-label="Check out">
  </div>
  <p class="form-hint">Bookings open from 20 Nov.</p>
</div>

Inline

.daterange-inline shows the calendar in the page, with no button. The range is saved as soon as the end day is picked. It shows one month, which fits in a card or a sidebar.

<div class="daterange daterange-inline" data-momo-daterange data-presets="7d,30d,month" aria-label="Time off">
  <input type="date" name="off-from" value="2026-12-21" aria-label="First day off">
  <input type="date" name="off-to" value="2026-12-24" aria-label="Last day off">
</div>

Sizes and states

.form-control-sm / -lg and .is-invalid / .is-valid on the first field carry over to the button, and so does disabled.

<div class="form-grid">
  <div class="daterange" data-momo-daterange aria-label="Small range">
    <input class="form-control-sm" type="date" name="s-from" aria-label="Start date">
    <input type="date" name="s-to" aria-label="End date">
  </div>
  <div class="daterange" data-momo-daterange aria-label="Invalid range">
    <input class="is-invalid" type="date" name="i-from" aria-label="Start date">
    <input type="date" name="i-to" aria-label="End date">
  </div>
  <div class="daterange" data-momo-daterange aria-label="Disabled range">
    <input type="date" name="d-from" value="2026-11-01" disabled aria-label="Start date">
    <input type="date" name="d-to" value="2026-11-30" disabled aria-label="End date">
  </div>
</div>

JavaScript

Both fields fire input and change, and the box fires momo:range with detail.from and detail.to (YYYY-MM-DD, empty when cleared). Form resets put the starting dates back.

const box = document.querySelector('.daterange');
box.addEventListener('momo:range', (e) => load(e.detail.from, e.detail.to));

Momo.daterange.get(box);                         // { from: '2026-11-02', to: '2026-11-15' }
Momo.daterange.set(box, '2026-12-01', '2026-12-31');
Momo.daterange.open(box);

Other options on the box: data-week-start="0" starts weeks on Sunday, data-locale="fr" changes the language (default: the page language), data-months="1" shows one month.

Accessibility

Start

OverviewStart Getting startedStart CustomizeStart

Guides

AccessibilityGuides BreakpointsGuides ChangelogGuides Customize componentsGuides JavaScriptGuides MotionGuides OptimizeGuides PhonesGuides RebootGuides Right-to-left (RTL)Guides Stacking orderGuides Using Momo with AIGuides

Foundations

ColorsFoundations TypographyFoundations ProseFoundations Images & figuresFoundations CodeFoundations Lines & shadowsFoundations Dark modeFoundations

Forms

Checkbox & switchForms ComboboxForms Date pickerForms Date rangeForms Fields & labelsForms File uploadForms Floating labelsForms Number stepperForms PasswordForms PIN codeForms RatingForms SelectForms SliderForms Tag inputForms Time pickerForms ValidationForms

Components

AccordionComponents Alert & bannerComponents AvatarComponents BadgeComponents BreadcrumbComponents ButtonComponents Button groupComponents CalendarComponents CardComponents CarouselComponents ChartsComponents ChipsComponents CollapseComponents Command paletteComponents CommentsComponents Confirm dialogsComponents Cookie bannerComponents Data tableComponents Description listComponents Dialog & toastComponents DividerComponents DrawerComponents Dropdown menuComponents Empty stateComponents File managerComponents Filter & sortComponents Gallery & lightboxComponents Inbox & chatComponents Infinite scrollComponents KanbanComponents Keyboard shortcutsComponents List groupComponents MarqueeComponents Media objectComponents Nav overflowComponents Notification centerComponents PaginationComponents ProgressComponents Pull to refreshComponents SkeletonComponents SortableComponents SpinnerComponents Split viewComponents Stat cardComponents Steps & wizardComponents Swipe actionsComponents TableComponents TabsComponents TimelineComponents TogglerComponents Tooltip & popoverComponents TourComponents Tree viewComponents VideoComponents WhiteboardComponents

Layout

Announcement barLayout App shellLayout Back to topLayout Container & sectionLayout ExamplesLayout FooterLayout HeroLayout JumbotronLayout Mega menuLayout NavbarLayout Site sidebarLayout

Sections

Bento gridSections Blog cardsSections Call to actionSections Contact & newsletterSections FAQSections FeaturesSections Logo cloudSections PricingSections TeamSections TestimonialsSections

Utilities

OverviewUtilities State variantsUtilities Display & flexUtilities Grid & gapUtilities SpacingUtilities SizingUtilities TextUtilities Links & color strengthUtilities Position & overflowUtilities BackgroundsUtilities Borders & effectsUtilities Transforms & filtersUtilities InteractionsUtilities

Helpers

Fixed, sticky & frostedHelpers Hover & focusHelpers Hover revealHelpers Icon linkHelpers PrintHelpers Relative timeHelpers Screen reader textHelpers Scroll inHelpers ScrollspyHelpers Share buttonHelpers Skip linkHelpers StacksHelpers Stretched linkHelpers Theme toggleHelpers Truncated textHelpers

Page patterns

404 pagePage patterns Coming soonPage patterns Login & registerPage patterns SettingsPage patterns ProfilePage patterns CRM contactsPage patterns ProjectsPage patterns File manager pagePage patterns Billing & plansPage patterns Help centerPage patterns Mobile app screensPage patterns
↑ ↓ moveEnter openEsc close