Calculation function to build a calender object.
npm i @egeonu/calender-calculate
A few examples of useful commands and/or tasks.
import { getPast } from "@egeonu/calender-calculate";
const past = await getPast(1997)
- endYear (number): Ending year for timeline.
- An array of months starting from January of the input year til December of the current year.
import { getYear } from "@egeonu/calender-calculate";
const date = new Date(2024, 10, 30);
const past = getYear(date)
- today (Date): Date of month to retrieve.
- An array of months starting from January til December of the input.
import { getMonth } from "@egeonu/calender-calculate";
const past = getMonth(31, 28, 7, false, 1997, "Monday")
- monthMax (number): Maximum number of days in the month.
- dayIndex (number): Numeric value for the day.
- monthIndex (number): Numeric value for the month.
- leap (boolean): True/false indicator if it is a leap year.
- yearIndex (number): Numeric value for the year.
- stringDay (string): String value for the day.
- weeks (Array): An array of weeks,
- month (string): String value for the month,
- index (number): Numeric value for the month.,
- year (number): Numeric value for the year.,
- isLeap (boolean): True/false indicator if it is a leap year.
import { getWeek } from "@egeonu/calender-calculate";
const past = getWeek(28, "Monday", 31)
- dayIndex (number): Numeric value for the day.
- stringDay (string): String value for the day.
- monthMaxIndex (number): Maximum number of days in the month.
- days (Array): An array of days (object below).
type Day = {
index?: number,
day?: string
};