Skip to content

edisdev/calendar.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

calendar.js

Generate calendar data with javascript πŸ“…

Using

  yarn add calendar-data-generate

or

  npm install calendar-data-generate
import Calendar from 'calendar-data-generate'

let currentDate = {
    year: new Date().getFullYear(),
    month: new Date().getMonth(),
    date: new Date().getDate(),
    firstDayOfWeek: 'monday' // 'sunday' or 'monday',
  },

let dateFormat = { day: '2-digit', month: 'long', year: 'numeric' }

let  disabledStartDate = {
  to: new Date(new Date().getTime() - ( 20 * 24 * 60 * 60 * 1000)),
  from: new Date(new Date().getTime() - ( 1 * 24 * 60 * 60 * 1000))
},

const pickerdata = new Calendar(
 currentDate,
 language,
 dateFormat, // date format
 textFormat, // short or long
 disabledRange // disabled datas
)

currentDate is the value of the first data in months, years, and days. In addition, the first day of the week is determined here with the firstDayOfWeek key.

Language of the data to be generated

Date format is in which format the result of the selected data will be generated.

TextFormat is for generating long or short versions of day & month texts.

disabledRange is for determine unavailable data. This is an object formed "to" and "from" keys.

About

Generate calendar data with javascript πŸ“…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published