1
I have a problem typing some time in Dialogflow for my chatbot. I know the system works with AM and PM, but I tried to format the date with Moment.js (follow the code below), but it is not working. When placing an input of 9h, 10h, 11h or 12h it recognizes respectively as 21h, 22h, 23h and 00h. Any suggestions?
function consulta(agent) {
let data = moment(agent.parameters.date).format('L');
let tempo = moment(agent.parameters.time).tz('America/Recife').format('HH:mm');
agent.add(`${data} às ${tempo}`);
}
I suggest [Edit] the question and put the value of
agent.parameters.time
, for cases that works and doesn’t work. So we can know better what might be happening (since now we can not know if it is a string, a Date, in which format comes, etc)– hkotsubo