Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

twix

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twix

Twix.js allows you to format date ranges

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
40K
increased by1.47%
Maintainers
1
Weekly downloads
 
Created
Source

Twix is a simple JS library for formatting date ranges. It currently depends on moment

Installing

Nodejs

npm install twix

Browser

<script src="moment.js"></script>
<script src="twix.js"></script>

Using

var t = new Twix("5/25/1982", "5/26/1982", {allDay: true});
t.toString(); //=> 'May 25 - 26, 1982'

I'll add the full documentation here, in the meantime, check out the tests.

TODO

  • Minified version
  • Remove moment dependency?
  • Format duration of range (e.g. "1 hour")
  • Format time until start of range (e.g. "in 1 hour")
  • Autodetect allDay
  • 24-hour time

Keywords

FAQs

Package last updated on 04 Jan 2012

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