Socket
Socket
Sign inDemoInstall

@date-io/luxon

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@date-io/luxon

Abstraction over common javascript date management libraries


Version published
Weekly downloads
608K
increased by4%
Maintainers
1
Weekly downloads
 
Created

What is @date-io/luxon?

@date-io/luxon is a date utility library that provides a consistent API for working with dates and times using the Luxon library. It is commonly used in conjunction with Material-UI pickers to handle date and time operations in a standardized way.

What are @date-io/luxon's main functionalities?

Parsing Dates

This feature allows you to parse dates from various formats. In this example, an ISO date string is parsed into a Luxon DateTime object.

const { DateTime } = require('luxon');
const date = DateTime.fromISO('2023-10-01');
console.log(date.toString());

Formatting Dates

This feature allows you to format dates into different string representations. In this example, the current date is formatted into a 'yyyy LLL dd' format.

const { DateTime } = require('luxon');
const date = DateTime.local();
console.log(date.toFormat('yyyy LLL dd'));

Date Arithmetic

This feature allows you to perform arithmetic operations on dates. In this example, 5 days are added to the current date.

const { DateTime } = require('luxon');
const date = DateTime.local();
const newDate = date.plus({ days: 5 });
console.log(newDate.toString());

Timezone Support

This feature allows you to work with dates in different timezones. In this example, the current date is set to the 'America/New_York' timezone.

const { DateTime } = require('luxon');
const date = DateTime.local().setZone('America/New_York');
console.log(date.toString());

Other packages similar to @date-io/luxon

Keywords

FAQs

Package last updated on 10 Jan 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc