General
Getting Started
Quick Install
Using with Cordova
Using with Vue.js
Using with Stencil.js
Using with ES Modules
Mobiscroll CLI
Working with the Source
Instance
Customizing the Look and Feel
Upgrade From Trial
Utility functions
Typings
Update version
Upgrade Guide v5
Date & Time pickers
Event Calendar
Form components
Pickers & dropdowns
Page layout
Tools
Accessibility
This version of the documentation is outdated. Check the latest version here!
Typings
From version 4.2.0 Mobiscroll for Javascript comes with type definitions files, that allow better usage in typescript environments.
Installing types
Type definition files come with the extension *.d.ts and are included in every Mobiscroll package from version 4.2.0. Installing and importing the mobiscroll package makes the types available as well.
Example installing and using the types with npm:
$ mobiscroll config javascript
After installation the package needs to be imported into the app with the needed types:
import { datepicker, Datepicker } from '@mobiscroll/javascript';
Usage
// Initializing the calendar and saving the instance
const inst = datepicker('#myID', {
theme: 'ios',
calendarScroll: 'vertical'
}) as Datepicker;
// Calling instance methods
inst.setVal(new Date());
inst.open();