Spanish date received from API

Hi everyone. I’m having some trouble while trying to insert to a date input element a date obtained from an API.

My API retrieves the date in the Spanish format: dd/mm/yyyy and when I use .toDate() function it messes up the order between date and month.

How could I change de order of the date received from the API in order to arrange it with the English format? I beleive I need to use .split() and other transformation function but maybe there’s a shorcut.

Thanks!!

Community Page
Last updated: