uld
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

uld - User local Date

npm version npm downloads npm downloads size Docs

A fast small utility to convert a date to a user-local date.

image

Usage

Install package:

# npm
npm install uld

# yarn
yarn install uld

# pnpm
pnpm install uld

Import:

// ESM
import { dateConverter } from 'uld'
const { year, month, day, hour, minute, second,localDate } = dateConverter(new Date()) //you can use any date ethier as a string or a data object

// CommonJS
const { dateConverter } = require('uld')
const { year, month, day, hour, minute, second, localDate } = dateConverter(new Date()) //you can use any date ethier as a string or a data object

// use the any of the above variables to display the date to your user in their local timezone
Prop usage type default
date The original date to be converted string or Date undefined
local The language of the output date (optional) string 'en'

💻 Development

  • Clone this repository
  • Enable Corepack using corepack enable (use npm i -g corepack for Node.js < 16.10)
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i uld

Weekly Downloads

9

Version

1.0.0

License

MIT

Unpacked Size

8.88 kB

Total Files

10

Last publish

Collaborators

  • mzaien