Day Picker
Provides api for a day picker with simple API.
Day Picker API is similar as for Node.js EventEmitter class, but provides only on, once, emit functions.
import { DayPicker } from "@tlgr/date-picker";
const dayPicker = new DayPicker(options);
extends​
constructor(bot, [options])​
 added in 1.0.0 bot- <Object>. Telegraf instance.options?- <Object>mode- <'edit' | 'new' | undefined>. Reply mode. Default isedit.date- <Date>. Started date. Default isDate.now().showPast- <boolean>. Show past dates. Iffalse- will render dates before Today as buttons with empty string. Default isfalselocale- <string>. date locale. Default isen-US.controls- <Object>. Controls options.
methods​
render()​
 added in 1.0.0 Returns Day picker grid.
properties​
date​
added in 1.0.0modifiers​
- readonly
 - getter
 
description​
returns current Date instance.
Events​
Events are not exported, but you can subscribe to events by it's name
Click​
added in 1.0.0name​
click
payload​
Next​
added in 1.0.0Fires when next month is clicked
name​
next
payload​
Previous​
added in 1.0.0Fires when previous month is clicked
name​
prev
payload​
Day​
added in 1.0.0Fires when subscribed on day event.
name​
day
payload​
Weekday​
added in 1.0.0name​
weekday
payload​
MonthYear​
added in 1.0.0Fires when Click on MM/YYYY button at the header of controls.
name​
monthyear