Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

just-date

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-date

Helper for dealing with JS dates independent of time or timezone.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
2
-84.62%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

JustDate

Helper for dealing with JS dates independent of time or timezone.

Why?

Dealing with dates in JavaScript is hard. JavaScript Date objects are represented as a point in time, with a time and timezone. However, a date that started as midnight on a Monday (UTC) may be rendered as 7 or 8pm on Sunday (EST). This becomes problematic when you don't even care about the time, but only ever show/manipulate the date.

This library helps with a few conventions:

  • Serialize and transmit dates as strings in YYYY-MM-DD format (no time or timezone is implied).
  • When deserializing to a Date object, parse these dates as midnight, local time.
  • Default formatted output without time (M/D/YYYY).

Install

npm install just-date
# or
bower install just-date

Usage

var JustDate = require('local-date');

var justDate = new JustDate('2015-01-01');

justDate.toString(); // => '2015-01-01'
justDate.toFormattedString(); // => '1/1/2015'
justDate.date // (instanceof Date) => 'Thu Jan 01 2015 00:00:00 GMT-0500...'

Testing

npm test

Keywords

date

FAQs

Package last updated on 20 Aug 2015

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