npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

telegram-bot-calendar-lite

v1.0.21

Published

Calendar for telegram bot

Readme

Calendar [RUS]

Простое создание календаря в телеграм боте

Установка

npm install telegram-bot-calendar-lite

Опции

| Название | Тип | По умолчанию | Описание | | ------------- | -------- | ------------------- | -------------------------------------------- | | dateNew | Date | new Date() | Инициализирует дату для создания календаря | | selectDay | string | current day | Может применяться для выбора нескольких дат | | monthNames | string[] | Russian month names | Название месяцев | | datesLock | Date[] | [] | Закрывает выбранные даты | | closeIcon | string | "❌" | Позволяет изменить иконку закрытых дат | | selectIcon | string | "✅" | Позволяет изменить иконку выбранных дат | | nextMonthIcon | string | ">>>" | Позволяет изменить иконку кнопки след. месяц | | prevMonthIcon | string | "<<<" | Позволяет изменить иконку кнопки пред. месяц |

Использование

const bot = new TelegramBot(token, {
  polling: true,
});
const { telegramCalendar } = require('telegram-bot-calendar-lite');

const calendar = new telegramCalendar();
const buttons = calendar.generateCalendar();

bot.sendMessage(chatId, "text", {
    reply_markup: buttons,
});

Использование со всеми аргументами

const calendar = new telegramCalendar(new Date(2024, 7, 1), 1, '2', "X", "*", "→", "←");

Переключение месяцев

Необходимо обработать callback «next_month» / «prev_month». Это включает добавление или вычитание месяца, передачу результата в функцию, а затем повторный вызов функции. Можно создать новое сообщение или отредактировать текущее.

const calendar = new telegramCalendar();

const botCallback = bot.on("callback_query", async (msg, match) => {
    const data = msg.data;

    if (data.includes("month_next")) {
        const newDate = new Date();

        newDate.setMonth(newDate.getMonth() + 1);
        calendar.setDate(newDate);

        let buttons = calendar.generateCalendar();

        bot.sendMessage(chatId, "test", {
            reply_markup: buttons,
        });
    }
})

Получение выбранной даты

const botCallback = bot.on("callback_query", async (msg, match) => {
    const data = msg.data;

    if (data.includes(".day_calendar")) {
        const date = data.replace(/\..*$/, "");

        /**
         * next code...
         */
    }
})

Существующие методы

• setDate(date) // Sets the calendar's current date.
• setMonthNames(names) // Sets custom month names.
• setSelectIcon(icon) // Sets the icon for selected dates.
• setPrevMonthIcon(icon) // Sets the icon for the previous month navigation.
• setNextMonthIcon(icon) // Sets the icon for the next month navigation.
• setCloseIcon(icon) // Sets the icon to close the calendar.
• setSelectDay(selectDay) // Sets the initially selected day.
• setDatesLock(datesLock) // Sets an array of dates to block.

Связаться со мной

Мой telegram

Calendar [ENG]

Easy Telegram calendar creation

Bash install package

npm install telegram-bot-calendar-lite

Options

| name | type | default | description | | ------------- | -------- | ------------------- | ------------------------------------ | | dateNew | Date | new Date() | initial Date display by the calendar | | selectDay | string | current day | helps in choosing multiple dates | | monthNames | string[] | Russian month names | Months names | | datesLock | Date[] | [] | closes selected dates | | closeIcon | string | "❌" | choose close icon | | selectIcon | string | "✅" | choose select icon | | nextMonthIcon | string | ">>>" | choose next month icon | | prevMonthIcon | string | "<<<" | choose prev month icon |

Using sample

const bot = new TelegramBot(token, {
  polling: true,
});
const { telegramCalendar } = require('telegram-bot-calendar-lite');

const calendar = new telegramCalendar();
const buttons = calendar.generateCalendar();

bot.sendMessage(chatId, "text", {
    reply_markup: buttons,
});

Using all options

const calendar = new telegramCalendar(new Date(2024, 7, 1), 1, '2', "X", "*", "→", "←");

Switch months

The "next_month" / "prev_month" callback needs to be handled. This involves adding or subtracting a month, passing the result to the function, and then recursively calling the function. A new message can be created or the current one edited.

const calendar = new telegramCalendar();

const botCallback = bot.on("callback_query", async (msg, match) => {
    const data = msg.data;

    if (data.includes("month_next")) {
        const newDate = new Date();

        newDate.setMonth(newDate.getMonth() + 1);
        calendar.setDate(newDate);

        let buttons = calendar.generateCalendar();

        bot.sendMessage(chatId, "test", {
            reply_markup: buttons,
        });
    }
})

Getting date

const botCallback = bot.on("callback_query", async (msg, match) => {
    const data = msg.data;

    if (data.includes(".day_calendar")) {
        const date = data.replace(/\..*$/, "");

        /**
         * next code...
         */
    }
})

Methods

• setDate(date) // Sets the calendar's current date.
• setMonthNames(names) // Sets custom month names.
• setSelectIcon(icon) // Sets the icon for selected dates.
• setPrevMonthIcon(icon) // Sets the icon for the previous month navigation.
• setNextMonthIcon(icon) // Sets the icon for the next month navigation.
• setCloseIcon(icon) // Sets the icon to close the calendar.
• setSelectDay(selectDay) // Sets the initially selected day.
• setDatesLock(datesLock) // Sets an array of dates to block.