1.0.8 • Published 5 months ago

datewise v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

This calendar is intended to be consumed for all of type javascript projects.

Table of contents

Installation

$ npm install datewise

We need stars (🌟🌟🌟🌟) to make available the package in cdnjs
please add star in git repository thank you all.

Usage

import Calendar, { ICalendar, IDay } from 'datewise';

const calendar: ICalendar = new Calendar();

Arguments

TypeDefault value
Date {Object}new Date()
Intl locales'en-US'

Calendar Methods

Methodargumentreturn type
toDateDate {Object}void
toPrevMonthnonevoid
toNextMonthnonevoid
toNextYearnonevoid
toPrevYearnonevoid
changeLocalelocale:stringvoid

Day Methods

Methodargumentreturn type
isWeekEndnoneboolean

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-US');

    calendar.days[0].isWeekEnd() // boolean
};

Calendar Object

keysvaluesexample
localestring'en-US'
valueDate {Object}new Date()
selectedDate {Object}new Date()
monthsstring[]"January",...
weekDaysstring[]"Saturday",...
daysDay[]new Day()

Day Object

keysvaluesexample
dateDate {Object}new Date()
statusTDateStatus'current-month'

Author

1.0.8

5 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

0.1.1

9 months ago

0.1.0

9 months ago

2.0.4

9 months ago