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

@logicamente.info/input-month-polyfill

v1.0.7

Published

Enables the use of inputs with month type in browsers that does not support it nativelly

Downloads

25

Readme

Input Month Polyfill

Travis npm package

This package enables the use of inputs with month type in browsers that does not support it nativelly.

What it does

It hides every month input, then add right after each one a DOM with events to handle user interaction.

When the user set a month and year with this polyfill, it automatically sets the correspondent value to the original month input, using the same value pattern that is expected from a month input (yyyy-mm).

It means, you don't need to track what this package is doing. Just keep following and sending your forms as if it was not even there.

Usage

Download it with your package manager:

$ yarn add input-month-polyfill
OR
$ npm i -S input-month-polyfill

Then add it to the end of your body:

<script src="./node_modules/@logicamente.info/input-month-polyfill/dist/input-month-polyfill.min.js"></script>

Or import it to your node app:

import '@logicamente.info/input-month-polyfill/dist/input-month-polyfill.min';

React compatible

  return (
    <input
      type="month"
      value={this.state.month}
      onChange={(e) => this.setState({ month: e.target.value })} />
  )

UI

Your users can use keyboard or mouse to interact with this package. Only keyboard arrows are allowed to change its value.

Left and right arrows are both used to change from month to year selection, vice-versa.

Up and down arrow are used to go to the next or previous month/year.

Internationalization

In order to use translated versions of this package, you are able to set the attribute data-lang with the prefered language. If not present, en is the default language.

Currently only en and pt-BR are available. Please, contribute with other languages!

<input type="month" data-lang="pt-BR">

Styling

The following are the classes used within this package. You can write your own CSS to override our default options. | CSS Class Name | Description | | :---: | :---: | | .imp--container | The entire package | | .imp--input | Text input that shows month and year | | .imp--viewers | Viewport that holds both month and year UI controllers | | .imp--month--viewer | Month UI controller | | .imp--year--viewer | Year UI controleler | | .imp--button | Every button within the package (except next/prev) | | .imp--month--button | Each button with month name at month viewer | | .imp--year--button | Each button with year number at year viewer | | .imp--viewer--controls | Block that holds prev and next year buttons | | .imp--year--button--prev | The prev button from year viewer | | .imp--year--button--next | The next button from year viewer |