Updated on Nov 18, 2020

Modern jQuery date & time picker

Mobile scroller and desktop dropdown for jQuery with advanced features and great UX

Mobile
Desktop

The date & time picker supports single, multiple & range selection with mobile & desktop optimized rendering and interaction model. Use it as a scroller and dropdown. Easily switch between scroller and calendar view or single and range selection.

The capabilities like built-in validation, minimum, maximum values, disabled dates are supported by both the scroller and calendar.

As part of Date, time & calendar it can be picked up with the Framework and Complete licenses or with the component license.

jQuery Date & Time Date & Time for jQuery and jQuery Mobile

Switch the layout between mobile & desktop
and see how it looks.

Date & Time - Mobile & Desktop usage

Change demo
Mobile & Desktop usage
Download and use example

Use the date & time for both mobile and desktop or set it up responsively.

The main difference between the two rendering modes is how the picker is laid out. Set the touchUi option to false and the component shows up suitable for larger screens and pointer interaction while setting it to true renders it suitable for touch screens.

Use the date picker on an existing form field, custom input or use it on Mobiscroll form fields. You can also embed it directly into your page. When linked to an input, the component will be shown on focus or when someone clicks on the field. Alternatively, you can leave the input editable and show the component only on a button click.

Handle different screen sizes by setting it up responsively  Check out the responsive demo →

Date & Time - Initializing the picker

Change demo
Initializing the picker

The date picker can be user on a Mobiscroll input or any other input part of an existing form.

There are two ways to use the date picker:

  • Initialize it on a single input, either Mobiscroll or non-Mobisroll input.
  • Embed the picker without an input. This can be the page itself or a more complex popup

Date & Time - Responsive behavior

Change demo
Responsive behavior
Download and use example

The date & time has a liquid layout, which means it nicely adapts to its surroundings. There are times however when you would like to set up the component responsively.

Use the responsive option to configure the picker and change the options based on the viewport width. There are five predefined breakpoints:

  • xsmall - min-width: 0px
  • small - min-width: 576px
  • medium - min-width: 768px
  • large - min-width: 992px
  • xlarge - min-width: 1200px
  • use custom for setting a custom breakpoint

It is a good idea to change the display or controls option to taiilor the UX. This way you can have a bottom positioned calendar on mobile, a popover anchored to the input on tablet and desktop display on large sceens.

Change the viewport

Date & Time - Understanding display modes

Change demo
Understanding display modes

The date picker has five built-in display modes that can be controlled through the display option:

  • top - modal that slides down from the top
  • bottom - modal that slides up from the bottom
  • center - modal that shows up in the middle with a pop animation
  • anchored - modal that shows up anchored to an input or any dom element
  • inline - embeddable picker that is rendered into the markup without its own modal

Use the touchUi option to switch between touch optimized mobile renderign and pointer optimized desktop renderign. It can be dynamically switched with the help of the responsive oprion.

The defaults change on a theme to theme basis. The ios theme comes with bottom on mobile and anchored on desktop while the material and windows themes have center on mobile and anchored on desktop.

Want to see how to set up responsiveness?  Check out the previous example →

Date & Time - Date selection

Change demo
Date selection

The date picker ships with four built-in variations for rendering the UI. The controls option supports the following:

  • date - renders a date-only scroller or dropdown control
  • time - renders a time-only scroller or dropdown control
  • datetime - renders a date & time scroller or dropdown
  • calendar - renders a calendar view for date picking

When passing controls: ['date'], the date picker will render a date-only picker - scroller for touchUi: true and a dropdown for touchUi: false.

You can further customize the dateFormat and dateWheels to fine-tune the UX... use it as a credit card expiration picker.

Interested in dynamically switching between modes?  Learn how to set up responsive behavior →

Once we started using Mobiscroll, our conversions have improved and the experience became much more delightful!

Daniel Maldonado, Sr. Web Designer, Ecommission Financial Services

Date & Time - Time selection

Change demo
Time selection

The date picker ships with four built-in variations for rendering the UI. The controls option supports the following:

  • date - renders a date-only scroller or dropdown control
  • time - renders a time-only scroller or dropdown control
  • datetime - renders a date & time scroller or dropdown
  • calendar - renders a calendar view for date picking

When passing controls: ['time'], it will render a time-only picker - scroller for touchUi: true and a dropdown for touchUi: false.

You can change the timeFormat or rely on the formats coming from the locale settings.

Interested in date selection?  Learn how to set up a date-only picker →

Date & Time - Date & time selection

Change demo
Date & time selection

The date picker ships with four built-in variations for rendering the UI. The controls option supports the following:

  • date - renders a date-only scroller or dropdown control
  • time - renders a time-only scroller or dropdown control
  • datetime - renders a date & time scroller or dropdown
  • calendar - renders a calendar view for date picking

Use controls: ['datetime'] for rendering a date & time picker within the same control, tied to the same input, or use them separately for two inputs - controls: ['date'] and controls: ['time']. It will render a scrollers for touchUi: true and a dropdowns for touchUi: false.

Interested in dynamically switching between modes?  Learn how to set up responsive behavior →

Date & Time - Setting time select steps

Change demo
Setting time select steps

Adjust the gaps between the time picker values as needed. Use these three options for setting the steps:

  • stepHour - adjusts the gaps between the values for the time wheel
  • stepMinute - adjusts the gaps between the values for the minute wheel
  • stepSecond - adjusts the gaps between the values for the second wheel

Date & Time - Single value selection

Change demo
Single value selection
Download and use example

Single value selection is the default behavior of the date picker. You can explicitly enable it by setting the selectMultiple to false.

You can dynamically switch between single and multiple select or range select which helps with building a system for one-way and two-way bookings.

Date & Time - Range selection

Change demo
Range selection

To enable range selection set the select option to range.

The microcopy for rangeStartLabel and rangeEndLabel can be easily overriden. For flight booking "Outbound" and "Return" makes sense while for accomodation booking "Check in" and "Check out" might be more appropriate.

Besides invalidating selection that is before and after a specific date, the minimum and miximum allowed length of a range selection can be enforced through the minRange and maxRange options.

Dynamically switching between single, multiple or range select can be done with option changes.

Looking for more range picker?  Learn how to customize range selection →

Date & Time - Date types

Change demo
Date types

The date & time picker works with different date types:

  • JS date object - a common way of passing a date is through a Date object: new Date(1995, 11, 17, 15, 24) (make sure to not simply pass a date string to new Date())
  • ISO date string - standardized way of passing dates: '2008-09-15T15:53:00' (make sure to pass it as a string)
  • Moment.js object - a great solution that solves common date management difficulties: moment([2018, 3, 27, 12, 15]) (make sure to have moment.js loaded)

When passing dates to the component - eg. min/max, invalids - you can do it in either format and the picker will automatically know what to do with it. If you want to specify how the picker should return values, you can do it in the returnFormat option.

Date & Time - Formatting values

Change demo
Formatting values

Use the dateFomat, timeFormat options to customize how the values show up in the inputs after selection. If the formats are not expicitly set, they are inherited from the localization settings.

Besides customizing the date and time formats you can reorder the picker wheels and change its formats with the dateWheels and timeWheels options.

Interested in learning about localization?  Check out how the return format changes based on locale →

Date & Time - Restricting with min & max

Change demo
Restricting with min & max

Configuring minimum and maximum selectable values is great for reducing mistakes. Help people by limiting the selections for the task at hand. Use the min and max options to restrict the selection. Setting the values will disable dates/times earlier than min and dates/times that come after max.

By default these options are empty and the date picker supports infinite navigation, while the time picker has all 24 hours/60 minutes/... available for selection. Values can be passed as JS date objects, ISO date strings or Moment.js objects.

Looking to invalidate more dates/times?  Discover how to disable specific values →

Date & Time - Disabling values

Change demo
Disabling values

Enforcing validation is essential to a great UX. First make sure to have the min & max values right and then work your way through disabled values.

Dates and times can be disabled through the invalid option. Another tool for setting disabled values are valid overrides. This means that you can make certain values valid from the invalid set. Eg. Invalidate all Tuesdays, but make Aug. 04, 2020 valid.

Both the invalid and valid options support the following:

  • Exact dates & times - Passing exact values like: '2020-05-20', '13:00', '2020-05-20T12:30:00' will disable specific day and/or times
  • Date & time ranges - Passing start and end value pairs will disable specific days and/or times that fall into that range
  • Recurring dates - Passing recurrence rules as objects or in RRULE strring format will be parsed. For more information on recurrence check out the rule generator

Exact dates and the start/end pairs can be passed as JS date objects, ISO date strings or Moment.js objects. Having invalids set up correctly not just enhances the UX, but improves performance.

Date & Time - Working with recurring values

Change demo
Working with recurring values

Disable recurring days, set marked or colored days with the help of the recurring object. Learn how to configure daily, weekly,monthly and yearly recurring dates and pass rule in the recurring property under the invalid option.

Use the configurator to experiment, build strings and objects that you can grab and use.

Interested in disabling dates?  Discover how to invalids work →

Date & Time - Theming capabilities

Change demo
Theming capabilities

The look and feel of the date picker can be deeply customized. There are four levels of customization:

  • Base themes: Choose between iOS, Material and Windows.
  • Light or dark: Every theme has a light and dark variant. Setting the themeVariant 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 from the header.

Date & Time - Lifecycle events

Change demo
Lifecycle events

The date picker 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.

For a complete list of events go to the documentation  See available lifecycle events →

Date & Time - Calendar systems

Change demo
Calendar systems

The date picker 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
Interested in localization?  Explore this example →

Date & Time - Localization

Change demo
Localization

All components are fully localized. In case of the date picker 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.

All settings can be manually overriden  See what options the localization impacts →

Date & Time - RTL mode

Change demo
RTL mode

RTL support is built in and can be explicitly controlled thorugh the rtl option. If not set, it is inherited from the locale settings.

Explore the different locales  Check out this example →

Looking for something you didn't see or have a sales question?
Ask us about it, we're here to help.

Get started with Mobiscroll for Angular

Use it in Angular 4+ projects or use it in Ionic Angular apps.


Give the components a try in a starter app or see how they look in your project.

Get started with Mobiscroll for React

Use it in React projects or use it in Ionic React apps.


Give the components a try in a starter app or see how they look in your project.

Get started with Mobiscroll for Javascript

Use it wherever Javascript runs.


Give the components a try in a starter app or see how they look in your project.

Get started with Mobiscroll for jQuery

Use it in you web app for mobile & desktop with jQuery.


Give the components a try in a starter app or see how they look in your project.

Already have an account?
Simple two minute install guide for jQuery and jQuery Mobile
Step 1.
Copy resources
Step 2.
Add references
Step 3.
Copy the code
Step 4.
Refresh browser
Copy the downloaded JS and CSS folders into your project

Extract the downloaded zip and grab the two folders. Make sure to place it where it can be reached from your html file.

file-copy-arrows

Or you can just simply try and play with the examples right from the folder you just unpacked.

Include the mobiscroll CSS and JS resources in your files

Add this script before the closing </head> tag of your file. Make sure to have jQuery loaded before this.

Copy code <link href="css/mobiscroll.jquery.min.css" rel="stylesheet" />
<script src="js/mobiscroll.jquery.min.js"></script>
Copy the code into your app

Grab the relevant parts and drop them into your JS, HTML and CSS files.

Copy JS
Copy HTML
Copy CSS
Take a look at what you've accomplished

Reload the page in your favorite browser

arrow-browser-reload@2x

And voilà, everything should be running smoothly.

If something is not running correctly or if there is trouble

Check out these common errors and solutions or reach out and let us help you.

install-help-bck
Simple two minute install guide for Javascript
Step 1.
Copy resources
Step 2.
Add references
Step 3.
Copy the code
Step 4.
Refresh browser
Copy the downloaded JS and CSS folders into your project

Extract the downloaded zip and grab the two folders. Make sure to place it where it can be reached from your html file.

file-copy-arrows

Or you can just simply try and play with the examples right from the folder you just unpacked.

Include the mobiscroll CSS and JS resources in your files

Add this script before the closing </head> tag of your file

Copy code <link href="css/mobiscroll.javascript.min.css" rel="stylesheet" />
<script src="js/mobiscroll.javascript.min.js"></script>
Copy the code into your app

Grab the relevant parts and drop them into your JS, HTML and CSS files.

Copy JS
Copy HTML
Copy CSS
Take a look at what you've accomplished

Reload the page in your favorite browser

arrow-browser-reload@2x

And voilà, everything should be running smoothly.

If something is not running correctly or if there is trouble

Check out these common errors and solutions or reach out and let us help you.

install-help-bck
Simple two minute install guide
Step 1.
Install the CLI
Step 2.
Install Mobiscroll
Step 3.
Copy the code
Step 4.
Run the app
Install the Mobiscroll CLI from npm

You will be able to figure Mobiscroll with ease in your app with the CLI

Copy command $ npm install -g @mobiscroll/cli
Install Mobiscroll in your React project

Run the following command in the root folder of your React project

Copy command $ mobiscroll config react --version=5

You will be prompted to log in with your mobiscroll account. Set your password here

Copy the code into your app

Grab the relevant parts and drop them into your JSX and CSS files.

Copy JSX
Copy CSS
Take a look at what you've accomplished

Run $ npm start in the root folder of your app

Copy command $ npm start

And voilà, everything should be running smoothly.

If something is not running correctly or if there is trouble

Check out these common errors and solutions or reach out and let us help you.

install-help-bck
Simple two minute install guide
Step 1.
Install the CLI
Step 2.
Install Mobiscroll
Step 3.
Copy the code
Step 4.
Run the app
Install the Mobiscroll CLI from npm

You will be able to figure Mobiscroll with ease in your app with the CLI

Copy command $ npm install -g @mobiscroll/cli
Install Mobiscroll in your React project

Run the following command in the root folder of your React project

Copy command $ mobiscroll config ionic --version=5

You will be prompted to log in with your mobiscroll account. Set your password here

Copy the code into your app

Grab the relevant parts and drop them into your TSX and CSS files.

Copy TSX
Copy CSS
Take a look at what you've accomplished

Run $ ionic serve in the root folder of your app

Copy command $ ionic serve

And voilà, everything should be running smoothly.

If something is not running correctly or if there is trouble

Check out these common errors and solutions or reach out and let us help you.

install-help-bck
Simple two minute install guide
Step 1.
Install the CLI
Step 2.
Install Mobiscroll
Step 3.
Copy the code
Step 4.
Run the app
Install the Mobiscroll CLI from npm

You will be able to figure Mobiscroll with ease in your app with the CLI

Copy command $ npm install -g @mobiscroll/cli
Install Mobiscroll in your Angular project

Run the following command in the root folder of your Angular project

Copy command $ mobiscroll config angular --version=5

You will be prompted to log in with your mobiscroll account. Set your password here

Copy the code into your app

Grab the relevant parts and drop them into your Component, Template and Module files.

Copy TS
Copy HTML
Copy Module
Copy CSS
Take a look at what you've accomplished

Run $ ng serve in the root folder of your app

Copy command $ ng serve

And voilà, everything should be running smoothly.

If something is not running correctly or if there is trouble

Check out these common errors and solutions or reach out and let us help you.

install-help-bck
Simple two minute install guide
Step 1.
Install the CLI
Step 2.
Install Mobiscroll
Step 3.
Copy the code
Step 4.
Run the app
Install the Mobiscroll CLI from npm

You will be able to figure Mobiscroll with ease in your app with the CLI

Copy command $ npm install -g @mobiscroll/cli
Install Mobiscroll in your Angular project

Run the following command in the root folder of your Angular project

Copy command $ mobiscroll config ionic --version=5

You will be prompted to log in with your mobiscroll account. Set your password here

Copy the code into your app

Grab the relevant parts and drop them into your Component, Template and Module files.

Copy TS
Copy HTML
Copy Module
Take a look at what you've accomplished

Run $ ionic serve in the root folder of your app

Copy command $ ionic serve

And voilà, everything should be running smoothly.

If something is not running correctly or if there is trouble

Check out these common errors and solutions or reach out and let us help you.

install-help-bck
Customize & try this demo locally
Sign in or start your free trial

We have to set you up with a trial for this to run 👍

Demos
Theme Select
Mobiscroll
Mobiscroll Dark
Material
Material Dark
iOS
iOS Dark
Windows
Windows Dark
Language Locale
See other demos and change options
Theme
Locale
See other demos