Skip to content

carboneio/dayjs-timezone-iana-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dayjs-timezone-iana-plugin

DayJS timezone plugin alternative to manage DST correctly, using https://www.iana.org/time-zones

Usage

   npm i dayjs-timezone-iana-plugin

In the code:

   // -> remove dayjs.extend(timezone)
   dayjs.extend(utc)
   dayjs.extend(require('dayjs-timezone-iana-plugin'))

   dayjs('2014-06-01 12:00').tz('America/New_York')
   // You can set a default timezone
   dayjsFactory.tz.setDefault('America/New_York')

Philosophy

The code is quite simple and is largely inspired by moment-timezone.

It includes the latest database IANA 2021e (96KB compressed). It takes more space than the method used by DayJS or Luxon. But it works even if NodeJS is compiled with small-icu.

How to update IANA DB

Todo

  • Add lot of tests (see moment-timezone tests)

Maintained by https://carbone.io/ and https://www.easilys.com/

About

DayJS timezone plugin alternative to manage DST correctly

Resources

License

Stars

Watchers

Forks

Packages

No packages published