1.0.8 • Published 8 months ago

datewise v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
8 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

8 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

0.1.1

11 months ago

0.1.0

11 months ago

2.0.4

11 months ago