npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@atlassian/date-time

v0.2.0

Published

Atlassian Frontend Date Time API

Readme

Date Time API

Atlassian license npm version workflow status PRs Welcome

Introduction

The Date Time API is a comprehensive library designed to simplify date and time manipulation in JavaScript. It provides a wide range of utilities for parsing, validating and formatting dates and times, making it easier for developers to handle date-time operations in their applications.

Usage

import * as dateTime from "@atlassian/date-time";

// Parse a date string
const date = dateTime.parse("2024-01-01");
console.log(date); // Outputs: "Mon Jan 01 2024 00:00:00 GMT+0000 (Coordinated Universal Time)"

// Get date pattern
const pattern = dateTime.getDatePattern("en-US");
console.log(pattern); // Outputs: "mm/dd/yyyy"

// Validate a date string
const isValid = dateTime.validate("2024-01-01");
console.log(isValid); // Outputs: true

// Format a plain date
const plainDate = dateTime.formatPlainDate(new Date());
console.log(plainDate); // Outputs: "2024-01-01"

// Format a plain time
const plainTime = dateTime.formatPlainTime(new Date());
console.log(plainTime); // Outputs: "12:00:00"

// Format a plain date-time
const plainDateTime = dateTime.formatPlainDateTime(new Date());
console.log(plainDateTime); // Outputs: "2024-01-01T12:00:00"

// Format a numeric date
const numericDate = dateTime.formatNumericDate(new Date(), "en-US");
console.log(numericDate); // Outputs: "1/1/2024"

// Format a date
const formattedDate = dateTime.formatDate(new Date(), "en-US");
console.log(formattedDate); // Outputs: "Jan 1, 2024"

// Format a time
const formattedTime = dateTime.formatTime(new Date(), "en-US");
console.log(formattedTime); // Outputs: "12:00:00 PM"

// Format a date-time
const formattedDateTime = dateTime.formatDateTime(new Date(), "en-US");
console.log(formattedDateTime); // Outputs: "Jan 1, 2024, 12:00:00 PM"

// Format a date-time with options
const formattedDateTimeWithOptions = dateTime.formatDateTimeByOptions({ second: undefined }, new Date(), "en-US");
console.log(formattedDateTimeWithOptions); // Outputs: "Jan 1, 2024, 12:00 PM"

// Format a duration
const duration = dateTime.formatDuration(new Date(2024, 0, 1), new Date(2024, 0, 2), "en-US");
console.log(duration); // Outputs: "1 day 1 hour 1 minute 1 second"

// Format a duration with custom options
const durationWithOptions = dateTime.formatDurationByOptions({ unitDisplay: "narrow" }, new Date(2024, 0, 1), new Date(2024, 0, 2), "en-US");
console.log(durationWithOptions); // Outputs: "1d 1h 1m 1s"

Installation

To install the Date Time API, use npm:

npm install @atlassian/date-time

Build

To build the Date Time API, use npm:

npm run build

Tests

To run the tests, use the following command:

npm test

Contributions

Contributions to Date Time API are welcome! Please see CONTRIBUTING.md for details.

License

Copyright (c) 2024 Atlassian US., Inc. Apache 2.0 licensed, see LICENSE file.

With ❤️ from Atlassian