

Android 4.2: December month missing in calendar - hendi_
https://code.google.com/p/android/issues/detail?id=39692

======
erydo
According to this comment:
<https://code.google.com/p/android/issues/detail?id=39692#c17>

It's caused by the convention of the Android datepicker to store month values
as 0-11 instead of 1-12.

Dates are given in 1-31 as expected; and years are given in e.g. 2012 as
expected; but months are given in 0-11 which is totally inconsistent with how
people normally number months and how the rest of the API works.

So for January 1st, 2012, printing 'getDate()', 'getMonth()', and 'getYear()'
would yield '1-0-2012'. It's a badly designed API and I'm surprised there
aren't more instances of this breaking.

(I ran into this once in our codebase, but we managed to fix it pretty
quickly).

~~~
trimbo
> months are given in 0-11 which is totally inconsistent with how people
> normally number months and how the rest of the API works

That numbering is consistent with Java and the constants in the Android API.

[http://docs.oracle.com/javase/1.4.2/docs/api/constant-
values...](http://docs.oracle.com/javase/1.4.2/docs/api/constant-
values.html#java.util.Calendar.JANUARY)

[http://developer.android.com/reference/java/util/Calendar.ht...](http://developer.android.com/reference/java/util/Calendar.html#JANUARY)

~~~
erydo
You're right, and I didn't doubt that. I meant it's self-inconsistent with how
days and years are handled, not necessarily inconsistent with other calendar
APIs within Java and Android. Sorry I wasn't clear.

~~~
solarexplorer
I guess the idea is to use the month as an array index to convert it into a
string. You don't usually convert the day of month or the year into a string.

Nontheless I agree that it's bad API design.

~~~
pwg
Then declare the array with 13 slots, fill slots 1-12 with the appropriate
strings, and don't use slot 0. Or better, put in an error check for being
passed a zero.

Suddenly, a 1-12 value for "month" is directly an index into an array to
convert the number into a string...

------
moondowner
Note for everyone checking only the screenshots and not reading all the
comments. The Calendar app is fine, the People app has this problem.

"It's only broken in the People app (like #29 said, Calendar is fine).

I'm running JOP40C, and I can confirm this bug (in the People app) with all
date formats."

~~~
Achshar
#29 seems to be missing. I didn't know comments can be deleted on that site.

------
nemof
I wonder if there's been any movement on the dreadful performance of 4.2? It
made me very aware that there is little to no support for Android/Nexus, and
nowhere to take problems unless you know what a bug tracker is, which many
will not.

~~~
talleyrand
I've noticed the exact same thing. 4.2 has ground my Nexus 7 to a halt. Turned
off NFC, which helped a lot, but it's still not as snappy as 4.1

~~~
yohui
That's curious. 8 or 16GB? I haven't run into it myself, but I've heard that
low free space will slow down the Nexus 7.

Stuff like better animations for the app switcher made my own Nexus 7 feel
faster after the 4.2 update. Of course, that's just a perceptual change.

Prior to 4.2, Chrome with many tabs open and Adobe Reader were my only major
annoyances. Chrome seems somewhat better, though since I've cut down on tab
usage and started using Firefox more I'm not sure how much it's really
improved. As for Reader, I just use ezPDF for larger documents now.

~~~
talleyrand
8G with plenty of free space.

------
javis
Wow. I was just feeling pretty stupid about some of the bugs in my code.
Thanks for the pick-me-up, Google.

------
AYBABTME
Thanks to Google, there shall be no 12-12-2012 apocalypse.

~~~
cmelbye
12-21 _

------
chmod775
Incoming iOS advert: "Supports all months, January to December"

~~~
meepmorp
This would never have been released Steve Jobs was still alive.

~~~
AYBABTME
Indeed, he would have called Eric Schmidt to let him know about this Android
bug before it being released.

------
olgeni
Perhaps Google thought it was a good idea to insert a leap month to check how
the kernel would behave.

Did anybody notice heavy CPU load?

------
teeja
Anybody who's never made a mistake with zero-indexed arrays, raise your hand!

~~~
arcatek
_o_

------
rickylais
Looks like we will be seeing Android 4.2.1 very soon

~~~
cjarl
Can't the People app be updated through the Play Store like Gmail?

~~~
rickylais
I don't think so.

------
harrylove
Someone call Nick Bostrom and let him know we have a test to discover if we're
living inside Android 4.2. Results pending.

------
csense
It's rather ironic that a company so high-tech it's looking hard at self-
driving cars and asteroid mining has trouble implementing a calendar, a
technology that's been around for thousands of years...

~~~
Evbn
The cars crash sometimes too. Software has bugs.

~~~
kaolinite
Have they? I thought the only crash was when a person in a car crashed into
the back of one? (pretty sure the self-driving car was being driven by a
person at that point too).

------
pfortuny
I wonder what the git blame command will contain...

