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

nh-picker

v4.0.2

Published

Nh-picker is a npm package that provides a simple and customizable date and time picker component for web applications. It allows users to select a date and time from a calendar interface, or to enter them manually. nh-picker supports various formats. nh-

Downloads

10

Readme

Date And Time Picker—Documentation

nh-picker is a javascript package that provides a simple and customizable date and time picker component for web applications. It allows users to select a date and time from a calendar interface, or to enter them manually. nh-picker supports various formats. nh-picker is lightweight, responsive, and accessible, and can be used for any kind of date and time input needs.

Installation

NPM install

npm i nh-picker

CDN

<!-- css -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nh-picker/style/nh-picker.min.css">
<!-- js -->
<script src="https://cdn.jsdelivr.net/npm/nh-picker/js/picker.min.js"></script>

Basic use

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Picker</title>
    <link rel="stylesheet" href="src/nh-picker.min.css">
</head>
<body>

<!-- To use date picker, you can use input type 'text' or 'date' -->
<input type="text" class="picker" name="birthday">
<!-- or -->
<input type="date" class="picker" name="birthday">

<script src="https://code.jquery.com/jquery-3.7.1.min.js"
        integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="src/picker.min.js"></script>
<script>
    $(function () {
        $('.picker').picker();
    });
</script>
</body>

To change html default date format, you can use...

<!-- default value 'yyyy-MM-dd' -->
<input type="date" class="picker" data-nh-date-format="dd-mm-yyyy" name="birthday">

or

$('.picker').picker({
    dateFormat: 'dd-mm-yyyy' // default value 'yyyy-MM-dd'
});

If you want to add minimum date and maximum date you can use...

<!-- default value 'null' -->
<input type="date" class="picker" data-nh-min-date="5/7/2022"
       data-nh-max-date="20/6/2024" name="birthday">

or

$('.picker').picker({
    minDate: '5/2/2023', // default value 'null'
    maxDate: '25/8/2024', // default value 'null'
});

Note: The minimum date and maximum date values will be the same format as your modified format.

To select the dateline, you can use...

<!-- This value will be 'true' or 'false' -->
<!-- default value 'false' -->
<input type="date" class="picker" data-nh-date-range="false" name="birthday">

or

$('.picker').picker({
    dateRange: true, // default value 'false'
});

To show today button, you can use...

<!-- This value will be 'true' or 'false' -->
<!-- default value 'true' -->
<input type="date" class="picker" data-nh-today="true" name="birthday">

or

$('.picker').picker({
    today: true, // default value 'true'
});

To show clear button, you can use...

<!-- This value will be 'true' or 'false' -->
<!-- default value 'true' -->
<input type="date" class="picker" data-nh-clear="true" name="birthday">

or

$('.picker').picker({
    clear: true, // default value 'true'
});

Time picker

To use Time Picker

<!-- To enable the time picker you need to set the input type to 'time' -->
<input type="time" class="picker">

<!-- To change time format you need to set data-nh-time-format.This value will be '12' or '24' -->
<!-- default value 12 -->
<input type="time" class="picker" data-nh-time-format="12">

or

$('.picker').picker({
    timeFormat: 12 // default value 12
});

Month picker

You can use ``Month Picker``` if you want to select month only `

<!-- default value false -->
<input type="time" class="picker" data-nh-month-select="true">

or

$('.picker').picker({
    monthSelection: true // default value false
});

Year picker

You can use ``Year Picker``` if you want to select Year only `

<!-- default value false -->
<input type="time" class="picker" data-nh-year-select="true">

or

$('.picker').picker({
    yearSelection: true // default value false
});

Picker Colour Theme

Only dark and light themes are available here. If you want to change the colour theme, you need to add a attribute Its name is data-nh-picker-theme. The value of the attribute will be dark, light or auto. Like...

<!-- default value auto -->
<input type="time" class="picker" data-nh-picker-theme="dark">

or

$('.picker').picker({
    theme: 'dark' // default value auto
});