Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
argon-calendar
Advanced tools
Readme
A customizable calendar component hackable to its core.
npm i argon-calendar
Argon calendar is not a regular calendar plugin. It's a a minimalistic and customizable library with a basic set of APIs. It uses native browser APIs under the hood.
If you are looking to build your own calendar plugin, this is the place where you start.
import ArgonCalendar from 'argon-calendar';
const calendar = new ArgonCalendar({
target: '#calendarTarget', // Target where calendar should be rendered. [mandatory]
weekStartsFrom: 0, // Default: 0. 0 is Sunday, 1 is Monday, and so on... [optional]
wrapTarget: false, // True for input types. Wrap existing target and place calendar inside the wrapping element. [optional]
numberOfCalendars: 2, // Default: 1. Number of months to be shown. [optional]
rangeSelection: false, // Default: false. If "true" then range selection is enabled. [optional]
showHeader: true, // Enable calendar header. [optional]
showFooter: true, // Enable calendar footer. [optional]
calendarWrap() { ... }, // To wrap current input element. Works only for "input" as a target. [optional]
calendarRoot() { ... }, // Customize calendar top level element. [optional]
calendarHeader() { ... }, // Customize calendar header. [optional]
calendarFooter() { ... }, // Customize calendar footer. [optional]
calendarBodyRoot() { ... }, // Customize calendar body element. [optional]
dayElement(day) { ... }, // Customize day element (Monday, Tuesday, Wednesday, etc.). [optional]
dateElement(dateString, dateObject) { ... }, // Customize date element. [optional]
monthElement(monthString, dateObject) { ... } // Customize month element. [optional]
});
calendar.prev(1 /* Optional skip parameter */); // Loads previous month(s). Optional "skip" parameter specifies how many months should be skipped.
calendar.next(1 /* Optional skip parameter */); // Loads next month(s). Optional "skip" parameter specifies how many months should be skipped.
A single date can be set if rangeSelection
is turned off.
calendar.setDate(/* Date object OR valid Date constructor arguments */);
A date range can be set if rangeSelection
is turned on.
calendar
.setStartDate(/* Date object OR valid Date constructor arguments */)
.setEndDate(/* Date object OR valid Date constructor arguments */) // These two methods will not re-render months
.jumpTo(/* Date object representing first month in the view */); // You should call this method to re-render months and diplay date range
const currentDate = calendar.getDate(); // Works if "rangeSelection" is turned off.
const startDate = calendar.getStartDate(); // Works if "rangeSelection" is turned on.
const endDate = calendar.getEndDate(); // Works if "rangeSelection" is turned on.
const today = calendar.getToday();
calendar.destroy();
Argon calendar does not support (and probably will never support) following features:
Please note that argon calendar does not assume how your calendar component should behave or look like. It provides a set of APIs which are crucial for a a calendar plugin to work. The plugin part is what you need to build yourself.
Argon calendar is a simple library, easy to understand and use. However, if you still face any issues, please feel free to log defects, provide suggestions or raise PRs. I would highly appreciate your contribution towards this project.
FAQs
A customizable calendar component hackable to its core.
The npm package argon-calendar receives a total of 4 weekly downloads. As such, argon-calendar popularity was classified as not popular.
We found that argon-calendar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.