I have two fields in my React-Native app, one for date and one for time. The date field returns a value of the format 'YYYY-MM-DD' and the time field returns a value of the format 'hh:mm A'.I'm using moment for format conversions. The final API call should be made with a single entry of the format 'YYYY-MM-DDTHH:mm', So to concatenate date and time I use,
moment(date+ " "+time).format("YYYY-MM-DDTHH:mm:ss")
It works fine in my simulators both Android and iOS and also when I debug on a device but as soon as I take builds for both it starts returning
Invalid Date.
EDIT : Tried moment(date + " " + value).format();, also returns 'Invalid Date' in builds.
Also tried doing it directly using Date new Date(date+ " " + time); without giving any formats, also returns 'Invalid Date' in the build.