dates-query

1.0.1 • Public • Published

Date-Query

Date Query is a small Javascript library for querying dates. If you have ever considered range of dates to be a mini database, then date-query will help you query them and get you results just like SQL does.

Installation

npm i dates-query --save

In Nodejs

const dq = require('dates-query') 

Without specifying any month

const a = dq.get.all('tue').in('2020')

console.log(a)
[
  '2020-01-07', '2020-01-14', '2020-01-21',
  '2020-01-28', '2020-02-04', '2020-02-11',
  '2020-02-18', '2020-02-25', ...
]

With month specific

const a = dq.get.all('tue').in('mar 2020')

console.log(a)
[ '2020-03-03', '2020-03-10', '2020-03-17', '2020-03-24' ]

Year range without specifying any month

const a = dq.get.all('tue').from('2019').to('2020')

Year range, specifying beginning month

const a = dq.get.all('tue').from('feb 2019').to('2020')

Year range, specifying ending month

const a = dq.get.all('tue').from('2019').to('mar 2020')

Year range, specifying beginning and ending months

const a = dq.get.all('tue').from('feb 2019').to('jun 2020')

Package Sidebar

Install

npm i dates-query

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

12.4 kB

Total Files

7

Last publish

Collaborators

  • suadik