Obsolete
Status Update
Comments
en...@google.com <en...@google.com>
po...@ideaknow.com <po...@ideaknow.com> #2
Bug keeps present in version 4.4(Kit-Kat)
be...@googlemail.com <be...@googlemail.com> #3
Still not fixed in 5.0.2 r1
wrong:
&& mTempDate.get(Calendar.DAY_OF_YEAR) != mMinDate.get(Calendar.DAY_OF_YEAR))
correct:
&& mTempDate.get(Calendar.DAY_OF_YEAR) == mMinDate.get(Calendar.DAY_OF_YEAR))
p.s. after 10months a "+1 me too" post is justified imo
wrong:
&& mTempDate.get(Calendar.DAY_OF_YEAR) != mMinDate.get(Calendar.DAY_OF_YEAR))
correct:
&& mTempDate.get(Calendar.DAY_OF_YEAR) == mMinDate.get(Calendar.DAY_OF_YEAR))
p.s. after 10months a "+1 me too" post is justified imo
en...@google.com <en...@google.com>
ch...@gmail.com <ch...@gmail.com> #4
Still not fixed in 5.1...
st...@gmail.com <st...@gmail.com> #5
Guys, this is still not fixed in M. Is this some kind of a joke?
wi...@gmail.com <wi...@gmail.com> #6
Easiest fix in the world and they weren't able to fix (or apparently even notice) this bug for over 3 years. How could they NOT notice this themselves? I mean their TESTS should've brought this up!
sa...@google.com <sa...@google.com> #8
Thank you for your feedback. We have tried our best to address the issue reported, however our product team has shifted work priority which doesn't include this issue. For now, we will be closing the issue as "Won't Fix (Obsolete)". If this issue still currently exists, we request that you log a new issue along with the latest bug report here: https://goo.gl/TbMiIO and reference this bug for context.
Description
I think the bug is clear in the source code. A short-circuit occurs in the first if-statement when the new min date has the same year as the old min date, even if the days are different. Furthermore, I the second portion of that statement should use the == comparison, rather than !=, since the function simply returns if the years don't match but the days do.
/**
* Sets the minimal date supported by this {@link NumberPicker} in
* milliseconds since January 1, 1970 00:00:00 in
* {@link TimeZone#getDefault()} time zone.
*
* @param minDate The minimal supported date.
*/
public void setMinDate(long minDate) {
mTempDate.setTimeInMillis(minDate);
if (mTempDate.get(Calendar.YEAR) == mMinDate.get(Calendar.YEAR)
^^---bug here
&& mTempDate.get(Calendar.DAY_OF_YEAR) != mMinDate.get(Calendar.DAY_OF_YEAR)) {
^^---and here
return;
}
mMinDate.setTimeInMillis(minDate);
mCalendarView.setMinDate(minDate);
if (mCurrentDate.before(mMinDate)) {
mCurrentDate.setTimeInMillis(mMinDate.getTimeInMillis());
updateCalendarView();
}
updateSpinners();