1
I have a field validation problem, in which when the date returns from my API in American format is made the conversion to Brazilian as below:
formatDate(date: string) {
if (!date) {
return '-'
}
const [year, month, day] = date.split(/[^\w\s]/gi);
return `${day}/${month}/${year}`;
}
But when my service returns the date in Brazilian format it changes to the American standard rsrsrsrs.... and it was to be in Brazilian format.
Does anyone have any suggestion how to validate this so that when comes Brazilian standard, continue Brazilian?
It seems to me more a problem of its service than of angular or algorithm. It would be better if it sent something like {day:xx, Month:xx, year:xxxx}
– Eduardo Vargas