I have a datepicker which was returning a moment object that was always in UTC timezone. I needed to do some logic on this date, but always wanted it in the users local timezone so I did the following:
//strip submission date of timezone offset let submission_date = moment(this.state.startDate).format('YYYY-MM-DD hh:mm:ss a'); submission_date = moment(submission_date); let last_date = this.last_date.diff(submission_date, 'days');
However, when I do this my iphone complains that submission_date is not a valid date. Desktop is fine so I'm guessing this is a safari issue. When I inspect
this.state.startDate just prior to being momentized it's a string like
Shouldn't moment accept that as a valid date?