2.1.0 • Published 3 years ago

@calipsa/tz-utils v2.1.0

Weekly downloads
1,113
License
ISC
Repository
github
Last release
3 years ago

@calipsa/tz-utils

NPM version Downloads Dependency status Dev Dependency status

Installation

# using npm:
npm install --save @calipsa/tz-utils

# or if you like yarn:
yarn add @calipsa/tz-utils

Available Methods

import {
  formatDateTz,
} from '@calipsa/tz-utils'

const date = new Date('2021-10-10T03:00:00.005Z')

const dateInNYTz = formatDateTz(date, 'yyyy-MM-dd hh:mm:ss', 'America/New_York')
import {
  names,
} from '@calipsa/tz-utils'

// names is an array containing all timezones as string values
import {
  deprecatedNames,
} from '@calipsa/tz-utils'

// deprecatedNames is an array containing all deprecated timezones as string values
import {
  notWorkingInDateFns,
} from '@calipsa/tz-utils'

// notWorkingInDateFns is an array containing all non-compatible timezones as string values
import {
  offset,
} from '@calipsa/tz-utils'

const offsetNYC = offset('America/New_York') // will return -240 (GMT-4)

const offsetKolkata = offset('Asia/Kolkata') // will return 330 (GMT+5:30)
import {
  offsetFormattedShort,
} from '@calipsa/tz-utils'

const offsetNYC = offset('America/New_York') // will return GMT-4

const offsetKolkata = offset('Asia/Kolkata') // will return GMT+5:30
import {
  offsetFormattedLong,
} from '@calipsa/tz-utils'

const offsetNYC = offset('America/New_York') // will return GMT-04:00

const offsetKolkata = offset('Asia/Kolkata') // will return GMT+05:30
import {
  suggested,
} from '@calipsa/tz-utils'

const timezone = suggested()

Usage

import {
  formatDateTz,
  names,
  offset,
  offsetFormattedLong,
  offsetFormattedShort,
  suggested,
} from '@calipsa/tz-utils'

// ...
2.1.0

3 years ago

2.0.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago