https://discord.gg/botpress logo
date time issue in webchat and emulator
# 🤝help
l
@prehistoric-airplane-85682 - here are the details the bot books appointments, it will ask the user to provide basic details along with date and time of appointment, the user can state in text "monday at 11am", the AI task will convert that into date. using Luxon today's date and time is provided to the AI task for reference the issue is that in does work in emulator, but not in the published code in webchat e.g. if today is 16th June and the user states next monday 11 am, i.e. 23rd June. Emulator gets it right. But webchat gets it as 19th June report_01JXWM5NVFCYDD2WQGQZNA92CD https://cdn.discordapp.com/attachments/1384187277823180871/1384187278594805781/WhatsApp_Image_2025-06-16_at_19.02.42_8c3e2d6c.jpg?ex=685c105c&is=685abedc&hm=c15496c7b27424ae900b78d54f3d28e790768946b85bb591b34966725a7bb832& https://cdn.discordapp.com/attachments/1384187277823180871/1384187278901121086/WhatsApp_Image_2025-06-16_at_19.05.36_ef60fc50.jpg?ex=685c105c&is=685abedc&hm=bf7da317596c51b02ec8890ae212477664aa6c72c031d1de94d42000af137ece&
@prehistoric-airplane-85682 - Any update on this issue
p
Although it is less user friendly, the easiest way to fix your issue would be to recommend to the user a specific format for the time of their appointment. I have yet to find a method to enforce a consistent and accurate response from your bot.
l
it is very hard to force the format, clients wont accept it It works in emulator, so there is some diff in the code execution in production
Any luck, the client has been chasing up
p
I have found out that there are backend differences between the emulator and the published webchat bots, which can explain the behaviour you're encountering. Unfortunately, the levelling up process will take a couple weeks.
l
Thanks Leanne, at least we know there is an issue. Do let me know when it is fixed
@prehistoric-airplane-85682 @bumpy-butcher-41910 - Time is of the essence - but it does not seem to work Another case 9/10 times the bot will get the text to date conversion wrong https://cdn.discordapp.com/attachments/1384187277823180871/1385940129067171960/image.png?ex=6857e4d4&is=68569354&hm=38dd3b8e106d90130229f9c2adc67c2c971bc7b035d3ae5c79ef7552d3e6a288&
but most of the times it wont
p
I don't think the autonomous node is the best way to approach your use case, have you tried using subworkflows with an Ai task for example?
l
the first example is not even an autonomous node
it is a workflow
{"body":"1st Aug at 12:00 noon"} input: { timer: '2024-08-01T12:00:00', message: 'Reminder: Beetlejuice The Musical is happening soon. Enjoy the show!' }, @prehistoric-airplane-85682 @bumpy-butcher-41910 - this issue just does not go away on every project that is being built date/time seems to be an issue, here in this example I gave 1st Aug at 12 noon and bot went to 2024
b
that's bizarre - sorry about that, Lijo
just to confirm, does this only happen when you're expecting the agent to assume a given date? (for example, like saying "next Monday" instead of "Monday the 28th"?)
l
Yes @bumpy-butcher-41910, whenever a textual context of date is provided to the AI, it always picks up a date from the past - I always have to solve this by using luxon date and passing the date context to the AI node. This is an ongoing issue, I face in almost every project