Month Picker
Provides api for a month picker with simple API.
Day Picker API is similar as for Node.js EventEmitter class, but provides only on
, once
, emit
functions.
import { MonthPicker } from "@tlgr/date-picker";
const dayPicker = new MonthPicker(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 isfalse
locale
- <string>. date locale. Default isen-US
.chunk
- <number | 'seasons'>. Monthrender()
grid size. Default is3
.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​
Month​
added in 1.0.0Fires when subscribed on day
event.
name​
month
payload​
Year​
added in 1.0.0name​
year