npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

js-custom-datepicker

v1.0.1

Published

Сalendar was written on javascript using es6 format and was redone to es5 using webpack and babel tools. There are many classes for easy styling for the desired website design.

Downloads

10

Readme

README

Description:

  • Сalendar was written on javascript using es6 format and was redone to es5 using webpack and babel tools. There are many classes for easy styling for the desired website design.
  • You can review the example here: - Demo

Install

###You can install it from npm:

npm install js-custom-datepicker --save

or download from git

git clone https://bitbucket.org/flexi-team/js-custom-datepicker.git

To use all capabilities of Сalendar, you need include js-custom-select and js-custom-scroll

npm install js-custom-scroll --save
npm install js-custom-select --save

or download from git

git clone https://bitbucket.org/flexi-team/js-custom-scroll.git
git clone https://bitbucket.org/flexi-team/js-custom-select.git

Usage

Include necessary style:

<link rel="stylesheet" href="/dist/js-custom-datepicker.css"/>

Html Code:

<input readonly id="inputForStatic" class="datePicker-input" type="text"/>
<div id="datePickerStatic" ></div>

Include necessary script:

<script async src="/dist/js-custom-datepicker.min.js" onload="InitDatePicker()"></script>

JavaScript Code:

<script type="text/javascript">
    function InitDatePicker() {
        var static = new jsCustomDatepicker(document.getElementById('datePickerStatic'), {
            between: true,
            minDate: new Date().format('dd-mm-YYYY'),
            years: {
                to: 2019,
                from: 2017,
            },
            select: {
                "max-height": 300,
                scroll: {
                    draggable: true,
                }
            },
            onSelect: function (input, date) {
                document.getElementById('inputForStatic').value = date.from + ' - ' + date.to;
            }
        });
        console.log(static);
    }
</script>

Properties:

  • dateFormat {String} - Format of the sent date. Defaults - dd-mm-YYYY
  • onSelect {Function} - The function to be executed after date selection.
  • width {Number} - Calendar width.
  • minDate {Boolean || String} - Defaults to false, You can specify min. Date.
  • maxDate {Boolean || String} - Defaults to false, You can specify the max. Date.
  • changeYear {Boolean} - Defaults to true, you can pass in false to disable component.
  • autoclose {Boolean} - Defaults to true, you can pass in false to disable component.
  • years: { from: minYear, to: maxYear } - Set the year range.
  • select: {object} - Sets options for custom-select.
  • select['max-height'] - Defaults to 200px.
  • binderID {Boolean || String} - Defaults to false, You can specify the id of the connected input to connect dates.
  • between {Boolean} - Defaults to true, you can pass in false to disable component. The range should be set in data-between. Example:
<input readonly id="datePickerInput" type="text" data-between='{"from":"07-06-2017", "to":"14-06-2017"}'/>
  • dragAutoClose {Number} - Delay time before closing.

You can specify options for the element directly. At first, those will be used which were sent during the initialization, and then these will be applied. They have the biggest priority. Example:

<input id="datePickerInput" data-options='{"binderID":"date-to"}' />