xgfe / react-native-datepicker

react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS
MIT License
2.12k stars 725 forks source link

new date moment to ignore timezones on just date #397

Open furkhail opened 4 years ago

furkhail commented 4 years ago
console.log(format, date);
console.log(Moment(date, format).toDate());
console.log(new Date(Moment(date).format(format)));
return Moment(date,format).toDate();

That log shows this:

YYYY-MM-DD 1984-10-19
1984-10-18T22:00:00.000Z
1984-10-19T00:00:00.000Z

This PR should solve that.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 97.368% when pulling 57bc4128731806e9024621b001ddeddfb95dbe9b on Feeld:master into 2a209bd4f11a84ff4543fbde930fed60dcbc0f68 on xgfe:master.