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 🙏

© 2026 – Pkg Stats / Ryan Hefner

glike35-date-time-picker

v1.1.2

Published

A flexible, i18n‑ready DateTimePicker component with timezone support

Readme

DateTimePicker

npm version npm downloads license types

Кастомный date/time/month picker на TypeScript для обычных input полей, форм и wrapper-интеграций.

Основная документация и живые примеры находятся в Showcase:

README оставлен как краткая точка входа: установка, быстрый старт, ссылки и релизные команды. Подробные options/events/methods, range-сценарии, формы, accessibility, troubleshooting и wrapper contracts поддерживаются в Showcase, чтобы документация не расходилась с реальным API.

Возможности

  • Режимы date, time, datetime-local, datetime, month.
  • Одиночный выбор и range-сценарии через workType: 'multi'.
  • Production range через два поля и rangeEndSelector.
  • Отдельные форматы отображения и отправки: displayFormat, valueFormat, displayFormatsByLang.
  • Локализация: lang, fallbackLang, встроенные ru/en/de, пользовательские translations.
  • Ограничения дат: minDate, maxDate, openToDate.
  • Timezone режимы: local, utc, IANA timezone string.
  • Ручной ввод с валидацией и aria-invalid.
  • Instance API: open, close, clear, getValue, setValue, getDate, setDate, destroy.
  • Event API: callback options и методы on, off, once, removeAllListeners.
  • Wrapper-интеграции для React, Vue 3, Angular и jQuery.

Установка

npm install glike35-date-time-picker
import { DateTimePicker } from 'glike35-date-time-picker';
import 'glike35-date-time-picker/dist/style.css';

const picker = new DateTimePicker('input[name="date"]', {
  lang: 'ru',
  mode: 'date',
});

Пакетный CSS заскоуплен под dtp-* и не переопределяет глобальные body, form или обычные input.

CDN

Для production-страниц используйте CDN-сборку:

<link
  rel="stylesheet"
  href="https://cdn.jsdelivr.net/npm/glike35-date-time-picker@1/dist/cdn/glike35-date-time-picker.css"
/>
<script src="https://cdn.jsdelivr.net/npm/glike35-date-time-picker@1/dist/cdn/date-time-picker.min.js"></script>

<input type="date" id="delivery-date" name="delivery_date" />

<script>
  const picker = new DateTimePicker('#delivery-date', {
    lang: 'ru',
    mode: 'date',
  });
</script>

Также доступен unpkg:

<script src="https://unpkg.com/glike35-date-time-picker@1/dist/cdn/date-time-picker.min.js"></script>

Базовые сценарии

Дата

<input type="date" name="date" />
new DateTimePicker('input[name="date"]', {
  lang: 'ru',
  mode: 'date',
});

Дата и время

<input type="datetime-local" name="starts_at" />
new DateTimePicker('input[name="starts_at"]', {
  lang: 'ru',
  mode: 'datetime-local',
  valueFormat: "yyyy-MM-dd'T'HH:mm",
});

Месяц

<input type="month" name="month" />
new DateTimePicker('input[name="month"]', {
  lang: 'ru',
  mode: 'month',
  valueFormat: 'yyyy-MM',
});

Range через два поля

<input type="date" name="check_in" /> <input type="date" name="check_out" />
new DateTimePicker('input[name="check_in"]', {
  lang: 'ru',
  mode: 'date',
  workType: 'multi',
  rangeEndSelector: 'input[name="check_out"]',
});

Публичного workType: 'range' нет. Диапазоны строятся через workType: 'multi'. Подробности: Range documentation.

Wrapper-интеграции

Поддерживаются React, Vue 3, Angular и jQuery.

Framework dependencies объявлены как optional peer dependencies. Для core API они не нужны; установите только dependency выбранной обертки: react/react-dom, vue, @angular/core/@angular/forms или jquery.

Каноничные wrapper contracts описаны в Showcase: options passthrough, events, methods/ref API, lifecycle cleanup, FormData и range integration.

| Интеграция | Импорт / файл | | ---------- | ------------------------------------------------------------ | | React | glike35-date-time-picker/wrappers/react/DateTimePicker.tsx | | Vue 3 | glike35-date-time-picker/wrappers/vue | | Angular | glike35-date-time-picker/wrappers/angular | | jQuery | wrappers/jquery.datetimepicker.js или CDN/example bundle |

Пример React:

import DateTimePicker, {
  DateTimePickerRef,
} from 'glike35-date-time-picker/wrappers/react/DateTimePicker.tsx';
import 'glike35-date-time-picker/dist/style.css';

const pickerRef = useRef<DateTimePickerRef>(null);

<DateTimePicker
  ref={pickerRef}
  name="date"
  mode="date"
  lang="ru"
  onChange={(value, date) => console.log(value, date)}
/>;

API Reference

Полный reference поддерживается в Showcase и автоматически сверяется с типами:

  • options из src/interfaces/IOption.ts;
  • events из src/types/DateTimePickerEvents.ts;
  • methods из публичного instance/static API;
  • wrapper snippets against source contracts.

Для локальной проверки:

npm run validate:showcase

Стили

Компонент настраивается через CSS custom properties. Полная справка:

Примеры

Showcase является каноничной документацией. Старые страницы в examples/cdn/* и examples/{react,vue,angular,jquery}/* используются как standalone/smoke fixtures.

Локальный запуск:

npm run dev

Разработка

npm install
npm run dev
npm run validate:showcase
npm run lint
npm test
npm run build

Перед коммитом после git add можно запустить тот же набор, что выполняет husky pre-commit:

npm run lint:staged

Релизные шаги описаны в BUILD.md.

Публикация

Перед публикацией проверьте:

npm run validate:showcase
npm run lint
npm test
npm run build
npm pack --dry-run

Текущая версия и изменения фиксируются в CHANGELOG.md.

Лицензия

MIT