Easily integrate an ASCII calendar into JavaScript applications with this simple npm package. Create customized calendar views by specifying year, month, and locale. Suitable for both Node.js and browser environments, it offers flexibility and ease of use for developers looking to enhance their projects.
A simple yet effective ASCII Calendar implementation, akin to the Linux cal command, designed for use in both Node.js and browser environments. This project provides a straightforward way to display ASCII calendars in JavaScript, adaptable to various locales and languages.
Features
- Locale Detection: Automatically detects and renders translations based on the system or browser locale, enhancing the user experience.
- Customizable: Allows users to specify the year, month, and language, making it flexible for different contexts.
Example Usage
To use the ASCII Calendar, simply require the module and call it with the desired parameters:
const cal = require('ascii-calendar');
console.log(cal({ year: 2021, month: 4, lang: 'en-US' }));
This will produce a visual calendar for May 2021 in the console:
May 2021
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Options
year: Specifies the full year for the calendar display.month: Represents the month, indexed from 0 (January).lang: Determines the language for the output (defaults to the system or browser locale).
This project serves as a valuable tool for developers looking to integrate a readable, console-based calendar in their applications.
No comments yet.
Sign in to be the first to comment.