Bug formatDate
-
When I send a date like “date.formatDate(‘2019/05/05’, ‘DD/MM/YYYY’)” it returns “05/05/2019”. But when I send date.formatDate(‘2019-05-05’, ‘DD/MM/YYYY’) it returns “04/05/2019”. Why is that happen?
-
Why would it return 04/05 if you pass it 05-05? Are you sure you’re passing it 05-05?
-
@DouglasCalora it’s not a bug, you are passing a string,
formatDate
expecting params (Date object, String format). in your case you can do something likedate.formatDate(new Date(‘2019-05-05’), ‘DD/MM/YYYY’)
. -
@metalsadman I’ve already tried pass a “New Date()” and didn’t work, I resolved with “new Date(value).toISOString().slice(0, 23)”
-