aio-date
Advanced tools
Comparing version 1.0.3 to 1.1.0
16
index.js
@@ -217,2 +217,15 @@ function AIODate(){ | ||
}, | ||
getDatesBetween(start,end,calendarType = 'gregorian'){ | ||
let type = Array.isArray(start)?'array':'string'; | ||
start = $$.convertToArray(start); | ||
end = $$.convertToArray(end); | ||
if(!$$.isGreater(end,start)){return []} | ||
let nextDate = $$.getNextDay(start,calendarType); | ||
let res = []; | ||
while($$.isLess(nextDate,end)){ | ||
res.push(type === 'array'?nextDate:`${nextDate[0]}/${nextDate[1]}/${nextDate[2]}`); | ||
nextDate = $$.getNextDay(nextDate,calendarType); | ||
} | ||
return res | ||
}, | ||
getDaysBetween(start,end){ | ||
@@ -281,5 +294,6 @@ if(end[0] - start[0] === 0){return Math.max($$.getDayIndexInYear(end) - $$.getDayIndexInYear(start) - 1,0);} | ||
getToday:$$.getToday, | ||
isMatch:$$.isMatch | ||
isMatch:$$.isMatch, | ||
getDatesBetween:$$.getDatesBetween | ||
} | ||
} | ||
export default AIODate |
{ | ||
"name": "aio-date", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
13502
296