flavienlaurent / datetimepicker

DateTimePicker is a library which contains the beautiful DatePicker that can be seen in the new Google Agenda app.
1.83k stars 578 forks source link

onDateSet returns 1 month earlier #99

Open avielg opened 9 years ago

avielg commented 9 years ago

When the method gets called the day and year params are fine but month is always 1 less than what I chose. e.g., I choose August and get 7 in onDateSet for the month parameter...

Currently I solved it with a simple and ugly month++;, but I was wondering if this is a bug or am I missing something here...?

moopat commented 9 years ago

The months are in the range 0-11 for compatibility with Calendar. See also http://developer.android.com/reference/android/app/DatePickerDialog.OnDateSetListener.html

kiralaw commented 9 years ago

:v ty