# Telegram-Date Picker

**URL:** https://discourse.nodered.org/t/telegram-date-picker/94194
**Category:** General
**Tags:** telegram
**Created:** [27 December 2024 07:27 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194 "2024-12-27T07:27:24Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [27 December 2024 07:27 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194/1 "2024-12-27T07:27:24Z")

</div>

I am revisiting this requirement.  
I want the user interacting through telegram to give me a valid-date (to generate a daily report for the given date). So i am trying to invoke a datepicker in telegram keyboard. anyone have any hint?  
I checked here, but was unable to get it converted to my requirement.

> [@Telegram Bot to ask for a date](https://discourse.nodered.org/t/telegram-bot-to-ask-for-a-date/79291/2):
>
> [demo1] something like this.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [27 December 2024 07:40 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194/2 "2024-12-27T07:40:43Z")

</div>

Plenty of clues in here I imagine: [https://flows.nodered.org/flow/328768dd440515c3b039d289313f95bc#:~:text=picker%20via%20Telegram.-,Overview,date%20manipulations%20throughout%20the%20flow](https://flows.nodered.org/flow/328768dd440515c3b039d289313f95bc#:~:text=picker%20via%20Telegram.-,Overview,date%20manipulations%20throughout%20the%20flow).

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [27 December 2024 08:46 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194/3 "2024-12-27T08:46:19Z")

</div>

Thanks for the direction. not sure why this didn't come in my search.  
I tried all the steps given in the post, but unable to get it going.  
i am getting a message :

```auto
27/12/2024, 14:13:53node: Initial Show Calendar
function : (error)
"TypeError: moment is not a function"

```

I have updated the correct settings.file (the same file which shows up in the startup log)

I think i have installed moment in the correct user folder, from where i am runnnig this instance of node-red. (how do i check if this is successful ?)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [27 December 2024 09:27 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194/4 "2024-12-27T09:27:44Z")

</div>

Did you install moment and add the requires to your settings.js  
As shown in the flows setup instructions. steps 1-3 [here](https://flows.nodered.org/flow/328768dd440515c3b039d289313f95bc#:~:text=picker%20via%20Telegram.-,Overview,date%20manipulations%20throughout%20the%20flow)

Or delete all references to

```auto
const moment = global.get('moment');

```

From any of the functions and add moment to the setup tab.

 ![chrome_screenshot_27 Dec 2024 09_25_16 GMT](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/e/6e0498376f9567dbdbc16a75f3a766dc3779c779.png)

Making sure functionExternalModules is set to true in the settings.js [Writing Functions : Node-RED](https://nodered.org/docs/user-guide/writing-functions#using-the-functionexternalmodules-option)

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [27 December 2024 09:35 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194/5 "2024-12-27T09:35:37Z")

</div>

> [@E1cid](#):
>
> delete all references to
> 
> ```auto
> const moment = global.get('moment');
> 
> ```

and  
adding moment in the setup tab worked...

---

<div class="post-metadata">

### Author: ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)
#### Post date: [27 December 2024 10:40 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194/6 "2024-12-27T10:40:58Z")

</div>

Happy Cake Day @E1cid

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [10 January 2025 10:41 UTC](https://discourse.nodered.org/t/telegram-date-picker/94194/7 "2025-01-10T10:41:22Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
