https://discord.gg/botpress logo
#🤝help
#Days Calculation in Botpress
# 🤝help
m

mysterious-airplane-65637

07/24/2023, 12:23 PM
Hi there! I am trying to capture 2 dates from users and output the #days between them. I tried implementing it with execute code but it still takes the default 0 when outputting the leaveCount variable value. Not sure why that is the case. Here is the code I used. Would really appreciate your help!

https://cdn.discordapp.com/attachments/1133011635104125069/1133011635267698718/Screenshot_2023-07-24_at_14.22.59.png

a

acceptable-kangaroo-64719

07/24/2023, 12:33 PM
Hey @mysterious-airplane-65637 that code looks correct. Let me play around with it a bit and get back to you
m

mysterious-airplane-65637

07/24/2023, 12:34 PM
Thanks so much @acceptable-kangaroo-64719 ! 🙂
a

acceptable-kangaroo-64719

07/24/2023, 12:39 PM
Hey @mysterious-airplane-65637 that code worked just fine for me. I put it in a bot here, you can check it out https://cdn.discordapp.com/attachments/1133011635104125069/1133015496258764843/BP_Coloring_Book_-_2023_Jul_24.bpz
m

mysterious-airplane-65637

07/24/2023, 12:46 PM
Thanks! Sorry but I only have access to Botpress Cloud version atm. Could you please share the file via link if its possible?
a

acceptable-kangaroo-64719

07/24/2023, 12:49 PM
that is a bp cloud version. You can download the file, then go to import/export > import from file

https://cdn.discordapp.com/attachments/1133011635104125069/1133018204843806911/image.png

m

mysterious-airplane-65637

07/24/2023, 12:53 PM
Awesome thanks! Trying it out now