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

bootstrap4-timezone-picker

v1.0.4

Published

Select your timezone using world map

Downloads

176

Readme

timezone-picker

timezone-picker is the plugin to select and get timezone value of selected area from WorldMap.

Demo: http://kevalbhatt.github.io/timezone-picker/


Imgur

Installation and usage


npm install --save timezone-picker

Include the following lines of code in the section of your HTML.

<script type="text/javascript" src="[yourpath]/jquery.min.js"></script>
<script type="text/javascript" src="[yourpath]/timezone-picker.js"></script>

Select any dom element where you want to create map.

$(selector).timezonePicker();

Options


  • width : (type:number) Sets width of map.
  • height : (type:number) Sets height of map.
  • defaultCss : (type:boolean) No need to include css if it is true
  • hoverColor :(type:string) Shows color on hover
  • selectedColor :(type:string) Sets selected ** timezone** color
  • mapColor :(type:string) Sets map color
  • quickLink :(type:Array of string) Creates shortcuts to select zone ["IST","MST".......]
  • selectBox :(type:boolean) If it is set tofalse select box will not be created
  • showHoverText : (type:boolean) If it is set to false hover text will not be shown
  • hoverText: (type:function | string) text you want to show when you hover on map (works only if showHoverText is true)
  • mapHover : (type:string) by default it will show hovered polygon(area) on which mouse is pointed (value: timezone, country, zonename)
    • "timezone" : when you hover on map it will heighlight all are with same timezone
    • "country" : when you hover on map it will heighlight all are with same country code
    • "zonename" : when you hover on map it will heighlight all are with same zonename

Methods


.setValue(string,string)

First parameter takes timezone string for example: 'Asia/Kolkata' (zone name). Second parameter is optinal when 1st parameter is zonename

$(selector).data('timezonePicker').setValue('Asia/Kolkata')

When you want to pass offset value as 1st parameter 2nd parameter should be 'offset'

$(selector).data('timezonePicker').setValue('5.5','offset')

When you want to pass country code as 1st parameter 2nd parameter should be 'country'

$(selector).data('timezonePicker').setValue('IN','country')

.getValue()

It returns object containing timezone details of seleted area:

$(selector).data('timezonePicker').getValue()

Sameple returned Object

  [
    {
        "selected":true,
        "zonename":"IST",
        "offset":5.5,
        "pin":"361,115",
        "country":"LK",
        "timezone": "Asia/Colombo",
    },
    {
        "zonename":"IST",
        "offset":5.5,
        "pin": "373,94",
        "country":"IN",
        "timezone": "Asia/Kolkata",
    }
]

License


It is available under the MIT LICENSE