cds

calendar-data-structure

Simple calendar data structure,

Showing:

Popularity

Downloads/wk

1

GitHub Stars

3

Maintenance

Last Commit

4yrs ago

Contributors

2

Package

Dependencies

0

Size (min+gzip)

1.1KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

CalendarDataStructure

Simple calendar data structure, will allow you to
  • Get the month data => a weeks array, each one with the data to create every day
  • Get the week data => simplified version of month data, just one week in the array
  • Move to the next or past month / week and get that data

Install

Direct
  • Download
  • Refer in HTML <script type="text/javascript" src="Path/To/File/calendar-data-structure.js"></script>
Browserify
  • Install: npm install --save calendar-data-structure
  • Module: require('calendar-data-structure')

Easy Use

  • Import var myCalendar = require('calendar-data-structure')
  • Instantiate var calendarInstance = new myCalendar(options)
  • Use calendarInstance.getWeeksArr()

Info

Options

Possible attributes

  • sixWeeksPerMonth => if true, force the weeks array to 6 elements
    • Boolean => false
  • weekStartDay => (0 - 6) Week day number
    • Integer => 0
  • actualDate => The date to start the calendar
    • Date => new Date()

Methods

  • getWeeksArr() => Return an array with the weeks for the actualDate month
  • getDaysArr([date]) => Return an array with days for the actualDate week
    • date => Date to use in week
  • setOtherDay(diff) => Change the date, by using an integer (Positive or Negative) that set the differential in days
    • diff => Integer that represent the days to add or remove from the actualDate
  • setOtherWeek(diff) => Change the date, by using an integer (Positive or Negative) that set the differential in weeks
    • diff => Integer that represent the weeks to add or remove from the actualDate
  • setOtherMonth(diff) => Change the date, by using an integer (Positive or Negative) that set the differential in months
    • diff => Integer that represent the months to add or remove from the actualDate
  • setOtherYear(diff) => Change the date, by using an integer (Positive or Negative) that set the differential in years
    • diff => Integer that represent the years to add or remove from the actualDate
IMPORTANT

this is the structure needed to create and navigate in the calendar, this will not decorate. Just return the array with the info, and allow you to surf future and past in calendar.

There is a big TODO list, but in resume
  • Write a better documentation
  • i18n Apply

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial