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

lddatetimepicker

v0.0.11

Published

vanilla date/time picker

Downloads

33

Readme

lddatetimepicker

Vanilla Date/Time picker.

Usage

install via npm, along with required libraries:

npm install --save lddatetimepicker @loadingio/debounce.js dayjs

include required js / css:

<link rel="stylesheet" type="text/css" href="dist/index.min.css">
<script type="text/javascript" src="path-to/debounce.js"></script>
<script type="text/javascript" src="path-to-day.js"></script>
<script type="text/javascript" src="dist/index.min.js"></script>

initialize:

lddtp = new lddatetimepicker({host: "input"})
lddtp.value("2021/01/23"); // set value
lddtp.value(); // get value

Constructor options:

  • host: host element ( should be an input element, if provided )
  • time: default true. hide and disable time picker if false.
  • suppress: default false. suppress popup when clicking host if true.
  • fixed: (deprecated) default false. true to enabled fixed mode.
  • mode: either in-place, out-place or fixed.
    • fixed:
      • when toggled, the datetime widget pops up in screen center, and covers the whole screen.
      • will be forced to true if host and container are not provided.
    • out-place: widget is inserted under body.
    • in-place: widget is inserted after host.
  • container: optional. if provided, lddatetimepicker are rendered barely in this container.
    • this should be an object with following fields:
      • node: required. container element.
      • toggle(v): required. function for toggling container on / off.
      • isOn(): required. return true if a container is toggled on, otherwise false.
      • position({x,y,ix,iy}): optional. use this function to correctly position container.
        • x: suggested x position
        • y: suggested y position
        • ix: suggested x position if mode is in-place.
        • iy: suggested y position if mode is in-place.
    • by default, mode will be out-place with container option set.
      • Set mode to fixed if the container is a fixed element (such as dialog)
  • zmgr: optional. if provided, widget will be auto z-indexing based on this zmgr.

API

  • isOn(): return true if lddatetimepicker dialog is on, otherwise return false
  • fire(n, ...args)
  • on(n, cb)
  • update()
  • value()
  • config(opt): update configuration. following options are supported:
    • suppress: see constructor option for this option.

License

MIT