Skip to content

Instantly share code, notes, and snippets.

View ASHIQUE-KV's full-sized avatar

Ashique K V ASHIQUE-KV

View GitHub Profile
@ASHIQUE-KV
ASHIQUE-KV / gist:12e1e2308c389a32d88c9127a44453c7
Last active April 17, 2020 15:31
Return an array of dates between two given dates. ( TypeScript)
/**
* Returns a {key: value} object where the key is a start date and the value is the date + 1 of the type of interval
* to the start date. When for weeks or months, it shows just the first date of the week/month.
*
** For days (start: '2017-12-25', end: '2018-01-02', interval: 'day'):
{ '2017-12-25': '2017-12-26',
'2017-12-26': '2017-12-27',
'2017-12-27': '2017-12-28',
'2017-12-28': '2017-12-29',