You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@neetohq/timezones

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neetohq/timezones

![npm version](https://img.shields.io/npm/v/@neetohq/timezones.svg) ![license](https://img.shields.io/npm/l/@neetohq/timezones.svg)


Version published
Weekly downloads
447
decreased by-17.68%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@neetohq/timezones

npm version license

A simple and lightweight NPM package for working with time zones. This package provides a human friendly timezone selector and utility functions for timezones.

Installation

You can install the package using npm:

npm install @neetohq/timezones

NeetoTimezoneSelector

Check out the live demo

import { NeetoTimezoneSelector } from "@neetohq/timezones";

new NeetoTimezoneSelector(document.getElementById("elementId"));

Configuration

You can pass options as the second parameter to configure the timezone selector component.

  1. elementId: ID for the NeetoTimezoneSelector. By default the ID will be timezone-selector
  2. className: Custom classes that can be added to the component.
  3. onChange: Function to be called when the timezone selector changes.
  4. position: Position in which the selector should open in. Available options: top, bottom. Default position is bottom.
  5. onHourFormatChange: Function to be called when the time format changes.
import { NeetoTimezoneSelector } from "@neetohq/timezones";

new NeetoTimezoneSelector(document.getElementById("elementId"), {
  className: "custom-selector-class",
  onChange: (timezone) => {
    console.log(timezone);
  },
  elementId: "custom-selector-element",
  position: "top",
});

ianaTimezoneToHumanReadble

import { ianaTimezoneToHumanReadable } from "@neetohq/timezones";

ianaTimezoneToHumanReadable("Asia/Calcutta") // => Indian Standard Time

ianaTimezoneToHumanReadable("America/New_York") // => Eastern Standard Time

ianaTimezoneToHumanReadable("Europe/Berlin") // => Central Standard Time

Development

Clone the repo

git clone git@github.com:neetohq/neeto-timezones.git
cd neeto-timezones/js
pnpm install
pnpm dev

Publishing to npm

  1. Bump package.json version
  2. Commit and push
  3. pnpm build && pnpm publish

FAQs

Package last updated on 11 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc