I have two datepicker
, one is startTime and other is endTime.
The problem is whenever I use setMinDate
function to endTime -> which need larger than startTime. If selected startTime is over the current TIME.
like ->
startTime = 2017/11/17 18:00:00
currentTime(real time) 2017/11/19 15:22:28
It will crash then shows below:
java.lang.IllegalArgumentException: fromDate: Fri Nov 17 18:00:00 GMT+08:00 2017 does not precede toDate: Fri Nov 17 15:22:28 GMT+08:00 2017
I am pretty sure that I am not passing any miniDate after current, however even the TIME over today but not date, it still crashed.
Can anyone help with this? thanks a lot!
Function called like this.
.setInitialDate(new SimpleDateFormat(DATE_FORMAT_24).parse(mEndTime.getText().toString()))
.setMinDate(new SimpleDateFormat(DATE_FORMAT_24).parse(mStartTime.getText().toString()))