Calendar for jQuery and jQuery Mobile
Learn moreDate & time picker component featuring calendar month view, week view, date scroller and time picker.
Use it on responsive websites and mobile apps. Compatible with mobiscroll forms, custom input and more.
Shipping with useful features for a refined UX, including:
- Usage on mobile and desktop with responsive features
- Single and multiple select
- Week select
- Date & time select
- Validation with disabled dates, min & max for restricting selection
- Marked days
- Week counter
- Multiple month view
- Fullscreen view
- Modal, popup and inline display support
- RTL Support
- Full localization
Interested in date and/or time selection? Other demos that could be useful:
Calendar demos available for other frameworks.
Viewing demos & code for
Calendar - Mobile & Desktop usage
Use the calendar view for both mobile and desktop or set it up responsively. The main difference between the two rendering modes - controlled by the touchUi
setting - is how the calendar is laid out.
When set to false
the component shows up suitable for larger screens and pointer interaction while setting it to true
renders it suitable for touch screens.
Calendar - App & Website usage
Use it on any custom input or with Mobiscroll form fields. The calendar is shown on input focus, but it can also be triggered on a button click or it can be embedded directly into the page.
Let’s say you already have a form and you want to enhance date selection. You can use it on existing fields or new fields.
Calendar - Date types
The calendar works with multiple data types:
- JS date objects -
new Date(1995, 11, 17, 15, 24)
- ISO date strings -
'2008-09-15T15:53:00'
- Localized date strings -
'04/25/2010 8:15 AM'
- Moment.js objects -
moment([2018, 3, 27, 12, 15])
Calendar - Mobile display modes
Different display modes can be used for mobile and desktop. On mobile, the calendar can be rendered at the top or bottom of the screen, in the center of the screen, anchored to an input or any object for that matter and it can also be embedded in any inline content.
Calendar - Desktop display modes
Use the available display modes on mobile and desktop. On larger screens you have slightly different rendering options suitable for the large form-factor and pointer interaction. Use the top, bottom and center modes for getting it in front of the users or stay in context and anchor it to the input.
Calendar - Responsive
Set up the Calendar to behave responsively. Use the appriopriate positioning and rendering based on the screen size. You can have a bottom positioned calendar on mobile, a popover anchored to the input on tablet and desktop display on large sceens.
All this can be configured under the responsive
setting where you pass the options for each breakpoint.
responsive: { xsmall: { ... }, small: { ... }, medium: { ... }, large: { ... }, xlarge: { ... } }
Calendar - Date picker
Use the calendar view for date selection. Navigate it by clicking the arrows next to the year and month or by swiping.
The dateFormat
controls how the selected value looks.
Check out some great examples for custom formats or if you are interested in a scroller UI, take a look at the date scroller.
Calendar - Date & Time picker
Besides date-only functionality you can use the component as a combined date and time picker. Select the date from a calendar view and the time woth an hour and minute picker.
Show the date and time in localized formats or customize it to your needs. Take a look at some of the formatting options available.
Calendar - Multiple day selection
You can pick between single and mutiple day selection. Multi-date select is useful when users need to pick from a set of dates that are not necessarily in a range. Passing select: 'multiple'
or a number, like select: 5
enables multiple day selection.
The latter also sets a maximum selectable, so passing select: 5
means a maximum number of five dates can be selected.
Calendar - Week selection
You can select entire weeks instead of single days. This is useful when users need to select a full week instead of a variable range. It can be activated with selectType: 'week'
. Single or multiple weeks can be selected based on the select: 'single','multiple' or integer
setting.
You can also control the day the week starts with the firstDay
setting.
Calendar - Variable week view
The calendar view supports variable weeks. Save space by only displaying one or two weeks or go for a full month where it makes sense.
Use the weeks
setting that expects a number of rows. The default is six weeks, but feel free to play around.
Calendar - Week to month view
While the calendar supports variable week views there are cases when you don't want to commit to a single setup. Get the best of both worlds by dynamically letting the users switch between a week-view and a full month-view.
Use the compact week-view
to save space and programatically switch to a month-view
when users need the full context of a month.
Calendar - Multi month view
Calendar - Min & max values
Use the min
and max
settings to restrict selection.
This is useful to make picking a date faster and to reduce user errors.
A great example is scheduling. You want to disable past dates and maybe enable selection from the next six months. Simply restrict values with the min and max.
Calendar - Setting invalids
Disable dates with the invalid
setting. It supports exact dates
, ranges
, recurring dates
and weekdays
.
Time can also be invalidated by passing exact values
and ranges
.
Using invalids is essential to a great UX. First make sure you have the min & max values right and then work your way back to invalids.
If you would like to re-enable dates inside an invalid range, you can do it with the valid
setting.
Having it set up correctly not just enhances the UX, but improves performance.
Calendar - Booking
Calendar - Marked, colored & labels
For additional information you can mark days with colored dots, add labels or completely color the background of the days. This offers means to add more information to the calendar that is valuable to users. Take a look at this example of marked days and description.
You can add these with exact dates
, ranges
, days of week
, days of month
and recurring dates
.
When processing a lot of data you can load the marked days, labels, colors dynamically in the onPageChange
event.
Calendar - Marked days
When using marked days, users might be interested to see what each dot means. You can place a listview below for describing what everything means.
Calendar - Showing week numbers
Enable week numbers with the weekCounter
setting. Counting yearly and monthly are both supported.
Use it whenever it is important to users having the week number in front of them. With weekCounter: 'year'
you can start the counter from the first until the last week of the year. weekCounter: 'month'
restarts the counter for every month.
Calendar - Month change direction
For a great user experience the calendar can be navigated a couple of different ways:
- By clicking or tapping on the little arrows above the calendar body
- With touchpad swipe gestures
- By grabbing and dragging the month with the mouse cursor
- With fluid swipe gestures on touchscreens
All this works in two directions: vertically and horizontally. Change the month change direction with calendarScroll: 'vertical'
and calendarScroll: 'horizontal'
.
Calendar - Setting values
Values can change a couple different ways: though defaults, intracting with the UI or programatically. The calendar defaults to now
, which can be easily overridden with the defaultValue
setting.
Values are set by interacting with the component and making a selection or it can be done programatically with the setVal
method.
Use the buttons
setting for showing/hiding set
, cancel
, clear
, now
or add custom buttons.
Calendar - Formatting values
Set the date and time format accordingly. Formats are inherited from the localization settings, but can be overriden with the dateFomat
, timeFormat
settings.
Calendar - RTL Support
Shipping with full RTL support, choose left-to-right or right-to-left with the rtl
setting.
The value is inherited from the localization settings and can be manually overriden by explicitly setting it true
or false
.
Calendar - Calendar systems
The calendar supports multiple calendar systems. You can control it with the calendarSystem
setting, and it supports the following options:
- Gregorian - it is included by default
- Jalali - it is the default system of the Persian calendar and is inlcuded within the Farsi language pack
- Hijri - it is included in the Arabic language pack
Calendar - Localization
The components are fully localized. In case of the calendar this covers date and time format, button copy, rtl and more. You can see how each example shows up by clicking on the small flag icon or checking the examples below.
Calendar - Event hooks
The calendar ships with different event hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code.
While users interact with the UI events like onChange
, onSet
, onInit
... will be triggered.
Interact with the example and check the event log for the output.
EVENTS FIRED:
Calendar - Theming capabilities
The look and feel of the calendar can be deeply customized. There are four levels of customization:
- Base themes: Choose between
Mobiscroll
,iOS
,Android Material
andWindows
. - Light or dark: Every theme has a
light
anddark
variant. Setting thethemeVariant
to'auto'
will switch based on system settings. - Custom themes: Use the theme builder to customize the colors and make it match your brand.
- Custom CSS: If you need further customization, the sky is the limit with CSS overrides.
You can also see how every example looks by changing the theme in the floating action bar on the right side.
Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.