diff --git a/.gitignore b/.gitignore index 5fa6bf09..9d9d9505 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +*.DS_Store + # built application files *.apk *.ap_ @@ -30,4 +32,4 @@ build *.iws *.ipr *~ -*.swp \ No newline at end of file +*.swp diff --git a/pickerview/src/main/java/com/bigkoo/pickerview/view/TimePickerView.java b/pickerview/src/main/java/com/bigkoo/pickerview/view/TimePickerView.java index 4742c6a9..b3b67070 100644 --- a/pickerview/src/main/java/com/bigkoo/pickerview/view/TimePickerView.java +++ b/pickerview/src/main/java/com/bigkoo/pickerview/view/TimePickerView.java @@ -198,9 +198,9 @@ private void setTime() { year = calendar.get(Calendar.YEAR); month = calendar.get(Calendar.MONTH); day = calendar.get(Calendar.DAY_OF_MONTH); - hours = calendar.get(Calendar.HOUR_OF_DAY); - minute = calendar.get(Calendar.MINUTE); - seconds = calendar.get(Calendar.SECOND); + hours = mPickerOptions.type[3] ? calendar.get(Calendar.HOUR_OF_DAY) : 0; + minute = mPickerOptions.type[4] ? calendar.get(Calendar.MINUTE) : 0; + seconds = mPickerOptions.type[5] ? calendar.get(Calendar.SECOND) : 0; } else { year = mPickerOptions.date.get(Calendar.YEAR); month = mPickerOptions.date.get(Calendar.MONTH);