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

d3-quarterly

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-quarterly

Parse quarterly date strings to timestamp ranges

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

d3-quarterly

## 2017 Ændrew Rininsland

Based off block by Chris Vaiu

d3-quarterly will parse a "quarter" string (e.g., "Q3 2017") and return a date object, indicating either the lower or upper bounds of a quarter.

Usage

  1. $ npm install d3-quarterly
  2. import quarterly from 'd3-quarterly'

test('General use', t => { const lower = quarterly('Q1 2017', false); const upper = quarterly('Q1 2017', true); t.is(lower.toISOString(), '2017-01-01T00:00:00.000Z'); t.is(upper.toISOString(), '2017-03-31T23:59:59.999Z'); });


### API

1. `quarterly(quarterString: string, returnBoundsEnd: boolean = false)`
    * quarterString
      - A string in the format 'QN YY(YY)?' where "N" is an integer 1-4 (incl.) and "YY(YY)?" is either a 2- or 4-integer year value

    * returnBoundsEnd
      - By default returns the lower bounds (i.e., the start) of a quarter. Pass `true` to return the upper bounds.

FAQs

Package last updated on 04 Sep 2017

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