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

ajv-material-pickers-time

v0.3.14

Published

Material design time picker

Downloads

41

Readme

material-pickers-time

Install

npm install material-pickers-time

Build

Requires the use of the gulp task runner and babel cli. To install globally, use npm install -g gulp babel-cli

  • Build - gulp
  • Test - gulp test:js
  • Run Locally - npm start
  • Build module-ready version - gulp && npm run build

About

Currently, the Material Design Lite project doesn't have any picker features implemented. There are a few other OS material picker libraries but they are either not actively maintained, or require heavy dependencies.

In need of a timepicker for a current project I made this library. Built with vanilla JavaScript and no dependencies. Written in ES6 and SASS.

The library currently supports both 12 and 24 time formats.

To check out live examples and view the test runner check out https://pickers.nickc.io/time.html

Options

Current only one option is implemented to change between 12 and 24 hour time. They are passed when one of the public API methods are called, merged with default options, and set the property mtpOptions on the input element specified.

{
timeFormat: standard or military by default it will be standard
}

API

bindInput

Adds an event listener to input element specified. When the input element triggers a focus event the timepicker will open.

parameters

inputEl: either a string selector, or a HTMLElement
options: (optional) options object to be set to input element object

example

const timepicker = new TimePicker();

// using a selector with no options
timepicker.bindInput('#selector');

// using a cached element with 24 time format
timepicker.bindInput(cachedEl, {timeFormat: 'military'});

openOnInput

Better suited for use in a framework environment where you want more customized control over the picker. When called it will immediately open with the input element specified in context.

parameters

inputEl: either a string selector, or a HTMLElement
options: (optional) options object to be set to input element object

example

const timepicker = new TimePicker();
const standardInput = document.querySelectorAll('#standard-input');

standardInput.on('focus', event => timepicker.openOnInput(event.target));