This calendar is intended to be consumed for all of type javascript projects.
$ npm install datewise
coming soon in cdnjs
import Calendar, { ICalendar, IDay,TDateStatus } from 'datewise';
const calendar: ICalendar = new Calendar();
Type | Default value |
---|---|
Date {Object} | new Date() |
Intl locales | 'en-US' |
Method | argument | return type |
---|---|---|
toDate | Date {Object} | void |
toPrevMonth | none | void |
toNextMonth | none | void |
toNextYear | none | void |
toPrevYear | none | void |
changeLocale | locale:string | void |
Method | argument | return type |
---|---|---|
isWeekDay | none | boolean |
Example:
const calendar = new Calendar();
const btn = document.getElementByTabName('button')[0];
btn.onclick = () => {
calendar.toDate(new Date(2025, 5, 16));
// calendar.toPrevMonth();
// calendar.toNextMonth();
// calendar.toNextYear();
// calendar.toPrevYear();
// calendar.changeLocale('en');
calendar.days[0].isWeekDay() // boolean
};
keys | values | example |
---|---|---|
locale | string | 'en-US' |
value | Date {Object} | new Date() |
selected | Date {Object} | new Date() |
months | string[] | ["January",...] |
weekDays | string[] | ["Saturday",...] |
days | Day[] | new Day() |
keys | values | example |
---|---|---|
date | Date {Object} | new Date() |
status | TDateStatus | 'current-month' |
- Gagik - Initial work - Gagik-arch