1.0.7 • Published 8 years ago
calendar-calculator v1.0.7
calendar-calculator
A plugin for calendar calculator , 中文
Install
npm install calendar-calculatorFeatures
- Highly customizable
- No dependence on UI, You can design by yourself
- Support browser、nodejs、miniProgram(小程序)
Usage
var oCalendar = new CalendarCalculator({
startDate: '2017-07-17',
endDate: '2018-08-18'
});
var months = oCalendar.getTotal();
console.log(months);Parameter
startDate- the start date formatted likeYYYY-MM-DDendDate- the end date formatted likeYYYY-MM-DD
Method
getTotal- get the total months fromstartDatetoendDate
Result
After use getTotal method will return the result structure below
[
{
title: '2017-07',
dates: [
{
date: '2017-06-25',
day: '25',
disabled: true,
isPrevMonth: true,
week: '日',
weekday: 0
}
...
]
}
...
]date properties
date- total date formattedYYYY-MM-DDday- date formattedDDweekday- weekday from0to6week- Chinese weekday日一二三四五六isPrevMonth- if it is previous month date, will betrueisNextMonth- if it is next month date, will betruedisabled- if it isisPrevMonth、isNextMonthor current month disabled date(not betweenstartDatetoendDate), will betrue