react-native-date icon indicating copy to clipboard operation
react-native-date copied to clipboard

min/max date expects user time, receives UTC

Open ashleydw opened this issue 9 years ago • 0 comments

https://github.com/nucleartux/react-native-date/blob/f284cdf93df17a300b79d830de44cf3b2c06244f/src/main/java/me/nucleartux/date/DatePicker.java#L48

picker.getDatePicker().setMinDate() expects a timestamp in the user time: http://developer.android.com/reference/android/widget/DatePicker.html#setMaxDate(long)

Sets the maximal date supported by this DatePicker in milliseconds since January 1, 1970 00:00:00 in getDefault() time zone.

mMinDate.getTimeInMillis() returns a timestamp in UTC:

https://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html#getTimeInMillis()

Returns: the current time as UTC milliseconds from the epoch.

ashleydw avatar May 04 '16 13:05 ashleydw