Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dayjs-abbr-timezone

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dayjs-abbr-timezone

A plugin for day.js that extends the 'format' function, enabling the correct output of abbreviated timezones instead of the standard GMT display.

  • 0.0.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
270
increased by53.41%
Maintainers
1
Weekly downloads
 
Created
Source

dayjs-abbr-timezone

This package is a plugin for day.js that enhances the format function to correctly output abbreviated time zones. This is especially beneficial when the standard z format does not meet your requirements.

For instance, when the timezone is set to Asia/Tokyo, the z format would usually output GMT+9. However, with this plugin, you can use the tz format to output JST correctly.

Installation

npm install dayjs-abbr-timezone

Usage

To use the plugin, first import it into your file:

import dayjs from 'dayjs';
import abbrTimezone from 'dayjs-abbr-timezone';

dayjs.extend(abbrTimezone);

Then you can use the format function with the tz option:

const date = dayjs('2023-01-01T12:00:00Z');
console.log(date.format('YYYY-MM-DD HH:mm:ss tz'));

This will correctly display the abbreviated timezone rather than the standard GMT display.

Issues and Contributions

If you encounter any issues or would like to contribute to the development of this plugin, please refer to this day.js issue or open an issue in this repository.

Keywords

FAQs

Package last updated on 13 Jun 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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc