Skip to content

jlarini/thedatepicker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TheDatepicker

Pure JavaScript Datepicker by Slevomat.cz.

Try DEMO

Install:

npm i thedatepicker

Download:

https://github.com/thedatepicker/thedatepicker/releases

Usage:

<html>
    <head>
        <script src="dist/the-datepicker.min.js"></script>
        <link rel="stylesheet" href="dist/the-datepicker.css">
    </head>
    
    <body>
        <input type="text" id="my-input">
    </body>
    
    <script>
        (function () {
            const input = document.getElementById('my-input');
            const datepicker = new TheDatepicker.Datepicker(input);
            datepicker.render();
        })();
    </script>
</html>

Customize:

TheDatepicker.Datepicker constructor accepts two arguments. First is an instance of input element, second is an instance of container element. Both are optional, but at least one must be present.

For example ...

<div id="my-container"></div>

const container = document.getElementById('my-container');
new TheDatepicker.Datepicker(null, container);

... will render datepicker into given <div>.

Options:

To see bunch of possible settings, visit https://thedatepicker.github.io/thedatepicker/

For example:

datepicker.options.setMinDate('today');

Enjoy

About

TheDatepicker - Pure JavaScript Datepicker 📅 (by Slevomat https://www.slevomat.cz)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 69.8%
  • HTML 27.6%
  • CSS 2.6%