This package has been deprecated

Author message:

please use package month-calculator instead

calendar-calculator

1.0.7 • Public • Published

calendar-calculator

Build Status

A plugin for calendar calculator , 中文

Install

npm install calendar-calculator

Features

  • 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 like YYYY-MM-DD
  • endDate - the end date formatted like YYYY-MM-DD

Method

  • getTotal - get the total months from startDate to endDate

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 formatted YYYY-MM-DD
  • day - date formatted DD
  • weekday - weekday from 0 to 6
  • week - Chinese weekday 日一二三四五六
  • isPrevMonth - if it is previous month date, will be true
  • isNextMonth - if it is next month date, will be true
  • disabled - if it is isPrevMonthisNextMonth or current month disabled date(not between startDate to endDate), will be true

Examples

License

Package Sidebar

Install

npm i calendar-calculator

Weekly Downloads

1

Version

1.0.7

License

MIT

Last publish

Collaborators

  • chanceyu