Change date format


(Felipe Marquardt) #1

is it possible to change the Entity DATE format to DD-MM-YYYY ?


(Yoga Ramya Mendu) #2

Hi @felipe,

The entity node with date type accepts any date inputs and converts it internally into the system time format and executes the rest of the flow.
Currently, there is no provision to set a specific date format to the date type entity node.

However, if you would like to execute the remaining flow with a specific date format, then you may add a script node immediately after the entity node and convert the date from the entity node to the required format using javascript.

Let us know if you need any further clarification on the scenario.

Regards,
Yoga Ramya.


(Andy Heydon) #3

It should also be noted that the MomentJS library is available in every script node through koreUtil.moment().
That library should be very helpful in parsing and reformatting dates and times.


(Felipe Marquardt) #4

Thank you both for the reply
This is a little far from my actual knowledge on JS. I will try it later.
One question thou…
I´d like to receive the date form the user and confirm with him in a more natural way, like:

  • Ok, the meeting is confirmed to 11-03-2019 at 13 o´clock.
    Is it possible to modify it to make simpler to read the bot response?

(Andy Heydon) #5

Moment has plenty of options.
https://momentjs.com/docs/#/displaying/


(Felipe Marquardt) #6

thank you @andy.heydon
I´ll take a look.