Timespan for Javascript

Updated on May 17, 2021
Learn More

Javascript Timespan Display modes

Try different display modes

With inline display you can embed the Timespan component in almost any markup or form.

Embedded timespan scroller
Hrs
00Hrs
01Hrs
02Hrs
03Hrs
04Hrs
05Hrs
06Hrs
07Hrs
08Hrs
09Hrs
10Hrs
11Hrs
12Hrs
13Hrs
14Hrs
15Hrs
16Hrs
17Hrs
18Hrs
19Hrs
20Hrs
21Hrs
22Hrs
23Hrs
24Hrs
25Hrs
26Hrs
27Hrs
28Hrs
29Hrs
30Hrs
31Hrs
32Hrs
33Hrs
34Hrs
35Hrs
36Hrs
37Hrs
38Hrs
39Hrs
40Hrs
00Hrs
01Hrs
02Hrs
03Hrs
04Hrs
05Hrs
06Hrs
07Hrs
08Hrs
09Hrs
Mins
20Mins
21Mins
22Mins
23Mins
24Mins
25Mins
26Mins
27Mins
28Mins
29Mins
30Mins
31Mins
32Mins
33Mins
34Mins
35Mins
36Mins
37Mins
38Mins
39Mins
40Mins
41Mins
42Mins
43Mins
44Mins
45Mins
46Mins
47Mins
48Mins
49Mins
50Mins
51Mins
52Mins
53Mins
54Mins
55Mins
56Mins
57Mins
58Mins
59Mins
00Mins
01Mins
02Mins
03Mins
04Mins
05Mins
06Mins
07Mins
08Mins
09Mins
10Mins
11Mins
12Mins
13Mins
14Mins
15Mins
16Mins
17Mins
18Mins
19Mins
20Mins
21Mins
22Mins
23Mins
24Mins
25Mins
26Mins
27Mins
28Mins
29Mins
30Mins
31Mins
32Mins
33Mins
34Mins
35Mins
36Mins
37Mins
38Mins
39Mins
40Mins
52Mins
53Mins
54Mins
55Mins
56Mins
57Mins
58Mins
59Mins
00Mins
01Mins
02Mins
03Mins
04Mins
05Mins
06Mins
07Mins
08Mins
09Mins
Secs
20Secs
21Secs
22Secs
23Secs
24Secs
25Secs
26Secs
27Secs
28Secs
29Secs
30Secs
31Secs
32Secs
33Secs
34Secs
35Secs
36Secs
37Secs
38Secs
39Secs
40Secs
41Secs
42Secs
43Secs
44Secs
45Secs
46Secs
47Secs
48Secs
49Secs
50Secs
51Secs
52Secs
53Secs
54Secs
55Secs
56Secs
57Secs
58Secs
59Secs
00Secs
01Secs
02Secs
03Secs
04Secs
05Secs
06Secs
07Secs
08Secs
09Secs
10Secs
11Secs
12Secs
13Secs
14Secs
15Secs
16Secs
17Secs
18Secs
19Secs
20Secs
21Secs
22Secs
23Secs
24Secs
25Secs
26Secs
27Secs
28Secs
29Secs
30Secs
31Secs
32Secs
33Secs
34Secs
35Secs
36Secs
37Secs
38Secs
39Secs
40Secs
52Secs
53Secs
54Secs
55Secs
56Secs
57Secs
58Secs
59Secs
00Secs
01Secs
02Secs
03Secs
04Secs
05Secs
06Secs
07Secs
08Secs
09Secs

Timespan - Basic usage

Change demo
Basic usage
Copy code

Timespan - Day/Hour/Minute span

Change demo
Day/Hour/Minute span
Copy code

Timespan - Steps

Change demo
Steps
Copy code

Timespan - Event handlers

Change demo
Event handlers
Javascript Timespan demo with event hooks for custom integration and functionality. With source code. Plain JS api for usage everywhere.
Clear event log
EVENTS FIRED: 
Copy code

Timespan - Display modes

Change demo
Display modes
Javascript Timespan picker with top, bottom slide up, popup, center, modal, bubble and inline embeddable display. Plain JS api for usage everywhere.
Copy code
mobiscroll.settings = {
    theme: 'ios',
    themeVariant: 'light'
};

mobiscroll.timespan('#demo', {
    display: 'bottom'
});

mobiscroll.timespan('#demo-top', {
    display: 'top'
});

mobiscroll.timespan('#demo-center', {
    display: 'center'
});

mobiscroll.timespan('#demo-bubble', {
    display: 'bubble'
});

mobiscroll.timespan('#demo-inline', {
    display: 'inline',
    layout: 'liquid'
});
<div mbsc-form>
    <div class="mbsc-form-group">
        <div class="mbsc-form-group-title">Try different display modes</div>
        <label>
            Bottom
            <input mbsc-input id="demo" placeholder="Please Select..." />
        </label>
        <label>
            Top
            <input mbsc-input id="demo-top" type="text" placeholder="Please Select..." />
        </label>
        <label>
            Center
            <input mbsc-input id="demo-center" type="text" placeholder="Please Select..." />
        </label>
        <label>
            Bubble
            <input mbsc-input id="demo-bubble" type="text" placeholder="Please Select..." />
        </label>
    </div>
    <div class="mbsc-form-group mbsc-padding">
        <p class="mbsc-thin">With inline display you can embed the Timespan component in almost any markup or form.</p>
    </div>
    <div class="mbsc-form-group">
        <div class="mbsc-form-group-title">Embedded timespan scroller</div>
        <div id="demo-inline"></div>
    </div>
</div>

Timespan - Theming capabilities

Change demo
Theming capabilities

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

  • Base themes: Choose between Mobiscroll, iOS, Android 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.

Copy code

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

Customize & try demos locally
Sign in or start your free trial

What framework are you using?

Javascript
jQuery
AngularJS
Angular
React
Other
Ionic Angular
Email address

Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Ionic project

Copy command
$ mobiscroll config ionic --version=4

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

Step 3.Copy the code into your app.

Copy TS
Copy HTML
Copy CSS
Copy Module

Step 4.Run ionic serve in the root folder of your app 🎉

Copy command
$ ionic serve

And voilà, everything should be running smoothly.

Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Ionic project

Copy command
$ mobiscroll config ionic --version=4

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

Step 3.Copy the code into your app.

Copy TSX
Copy CSS

Step 4.Run ionic serve in the root folder of your app 🎉

Copy command
$ ionic serve

And voilà, everything should be running smoothly.

Customize & try demos locally
How would you like to do it?
Install demo in your app
Follow this quick, two minute install guide
Close window

Step 1.Install the Mobiscroll CLI from npm

Copy command
$ npm install -g @mobiscroll/cli

The CLI makes configuring your apps super simple 👍

Step 2.Run the following command in the root folder of your Angular project

Copy command
$ mobiscroll config angular --version=4

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

Step 3.Copy the code into your app. HTML goes into the markup, TS into Typescript.

Copy TS
Copy HTML
Copy CSS
Copy Module

Step 4.Run ng serve in the root folder of your app 🎉

Copy command
$ ng serve

And voilà, everything should be running smoothly.

Thanks for downloading
Try and customize the app locally

Extract the zip file and run the project like any Ionic app. Make sure to have Ionic CLI installed and open the terminal in the app root folder.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ionic serve

Let us know if we can help and enjoy!

Thanks for downloading
Customize demos locally

We have set up a trial so that you can try the demos locally.

Extract the zip file and open the demo in your favorite browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

Please extract the zip file and run the project like any Angular CLI app. Make sure to have the Angular CLI installed.

For installation and usage, extract the zip file and open a terminal window and follow these steps.

Step 1. Run in root folder
$ npm install
Step 2. Start the app
$ ng serve --open

Let us know if we can help and enjoy! 👍

Thanks for downloading
Customize demos locally

We have set up a trial so that you can try the demos locally.

The easiest way to get started is to follow the installation steps and by grabbing the code directly from the demo page. Let us know if we can help and enjoy! 👍

You'll find a fully functional Kitchen-sink Ionic app in the zip file.

Thanks for downloading
Customize demos locally

We have set up a trial so that you can try the demos locally.

The demos are using Babel's in-browser ES6 and JSX transformer.
Extract the zip file and open the demo in your browser. To install Mobiscroll in your project follow instructions from this page.


Let us know if we can help and enjoy! 👍

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 👍

Email address

Need to update your password?
Demos
Theme Select
Mobiscroll
Material
Material Dark
iOS
iOS Dark
Windows
Windows Dark
Language Locale
See other demos and change options
Theme
Locale
See other demos