get-calendar-dates
Get all ISO calendar dates in a string
;//=> ['2015-01-25' '20150126']
Installation
Package managers
npm
npm install get-calendar-dates
bower
bower install get-calendar-dates
Duo
var getCalendarDates = ;
Standalone
Download the script file directly.
API
getCalendarDates(string [, options])
string: String
options: Object
Return: Array
of String
It returns an array of calender dates (YYYY-MM-DD and YYYYMMDD) included in the string.
options.basic
Type: Boolean
Default: true
false
avoids matching the basic format (YYYYMMDD).
; //=> []
options.extended
Type: Boolean
Default: true
false
avoids matching the extended format (YYYY-MM-DD).
; //=> []
calendarDateRegex.noDay(string)
string: String
Return: Array
of String
It returns an array of calender dates with reduced precision (YYYY-MM) in the string.
getCalendarDates; //=> ['2015-01']
License
Copyright (c) Shinnosuke Watanabe
Licensed under the MIT License.