I have 2 kinds of date strings coming back to the UI. One date format has timezone and the other doesn’t.
The date string that has timezone displays the date correctly but the date string with no timezone displays the previous date.
how can I handle both the scenarios properly?
Here’s how I have it in my app:
const d = new Date("2022-03-25"); // Thu Mar 24 2022 19:00:00 GMT-0500
const x = new Date("2022-12-14T06:03:14Z"); // Dec 14 2022 00:03:14 GMT-0600