- Material Design - Date and Time Picker
- It is an independent component that lets you add the Material Design Pickers to your websites. It does rely on just Moment Js and aims to optimize for cross-device use
Looks
Note: These might not be the actual representation of the dialog at all times and so is used for visual representation only
The dialogs look like this when opened.
Features
1.Supports all material design palettes
Note: for more information on these colours refer the official spec
2.Dark Theme support (yay!)
3.Supports i18n infrastructure i.e works with multiple languages
Note: For a list of all locales see moment locales and to download the ones you require use moment with locales or individual ones here locales repo
Tools
This component sits on shoulders of giants and so is powered by
Examples
Here are some usage examples
<link href='https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/mdDateTimePicker.css"> <script src="js/moment.js"></script> <script src="js/mdDateTimePicker.js"></script>
var dialog = new mdDateTimePicker.default({
type: 'date'
});
var toggleButton = document.getElementById('id-of-button-to-open-it');
toggleButton.addEventListener('click', function() {
dialog.toggle();
});
<link href='https://fonts.googleapis.com/css?family=Roboto:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/mdDateTimePicker.css"> <script src="js/moment.js"></script> <script src="js/draggabilly.pkgd.min.js"></script> <script src="js/mdDateTimePicker.js"></script>
var dialog = new mdDateTimePicker.default({
type: 'time'
});
var toggleButton = document.getElementById('id-of-button-to-open-it');
toggleButton.addEventListener('click', function() {
dialog.toggle();
});
For an example with umd see link