You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

intl-date-time

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

intl-date-time

A tiny wrapper around the native Intl.DateTimeFormat, with predefined formats.

1.0.1
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

NPM Version CI Dependency Status Dev Dependency Status

Intl.DateTime

A tiny wrapper around the native Intl.DateTimeFormat, with predefined formats.

Table of Contents

Features

  • 🎉 Uses native the Intl.DateTimeFormat API.
  • 🚀 Zero dependencies, super tiny.
  • 💪 Written in TypeScript.

Installation

npm install --save intl-date-time

Usage

import { format } from 'intl-date-time';

format(date, 'mediumDate');
// Aug 1, 2020

format(date, 'shortTime');
// 6:32 PM

Alternatively, you can get the format options for manual use.

import { getOptions } from 'intl-date-time';

const options = getOptions('longDate');
new Intl.DateTimeFormat('en-US').format(date, options);
// August 1, 2020

Formats

FormatExample
short08/1/20, 6:32 PM
mediumAug 1, 2020, 6:32:21 PM
longAugust 1, 2020, 6:32:21 PM PDT
fullSaturday, August 1, 2020, 6:32:21 PM PDT
shortDate08/1/20
mediumDateAug 1, 2020
longDateAugust 1, 2020
fullDateSaturday, August 1, 2020
shortTime6:32 PM
mediumTime6:32:21 PM
longTime6:32:21 PM PDT

Development

npm install
npm run build

Keywords

date

FAQs

Package last updated on 01 Jun 2020

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