Android: DatePicker shows wrong month
See original GitHub issueTell us about the problem
For 9th and 10th months DatePicker shows October.

Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
- CLI: 3.1.3
- Cross-platform modules: 3.2.0
- Runtime(s): 3.2.0
- Genymotion Android 7.1.0 Samsung Galaxy S7
Please tell us how to recreate the issue in as much detail as possible.
Here is the repo demonstrating the bug: https://github.com/terreb/ns-datepicker
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
/app/main-page.xml
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo" class="page">
<StackLayout>
<DatePicker day="1" month="9" year="2017" verticalAlignment="center"/>
<DatePicker day="1" month="10" year="2017" verticalAlignment="center"/>
</StackLayout>
</Page>
/app/App_Resources/Android/values-v21/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Application theme -->
<style name="AppTheme" parent="AppThemeBase">
<item name="android:datePickerStyle">@style/SpinnerDatePicker</item>
<item name="android:timePickerStyle">@style/SpinnerTimePicker</item>
</style>
<!-- Default style for DatePicker - in spinner mode -->
<style name="SpinnerDatePicker" parent="android:Widget.Material.Light.DatePicker">
<item name="android:datePickerMode">spinner</item>
</style>
<!-- Default style for TimePicker - in spinner mode -->
<style name="SpinnerTimePicker" parent="android:Widget.Material.Light.TimePicker">
<item name="android:timePickerMode">spinner</item>
</style>
<style name="NativeScriptToolbarStyle" parent="NativeScriptToolbarStyleBase">
<item name="android:elevation">4dp</item>
</style>
</resources>
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
DatePicker shows wrong value of month - Stack Overflow
In Android, when you select a date from the date picker, it starts counting the months from 0. So, this means that the...
Read more >[Solved]-DatePicker in Kotlin showing wrong month-kotlin
Coding example for the question DatePicker in Kotlin showing wrong month-kotlin.
Read more >Pickers | Android Developers
Android provides controls for the user to pick a time or pick a date as ready-to-use dialogs. Each picker provides controls for selecting ......
Read more >DatePicker Tutorial With Example In Android Studio
In Android, DatePicker is a widget used to select a date. It allows to select date by day, month and year in your...
Read more >Date picker is showing wrong dates on Android app.
Hi,. My calendar looks funny on the mobile app. It is mismatching dates with the weekdays for the current month. It is showing,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @vakrilov, thank you for the explanation and I confirm the issue is fixed after I changed to “tns-core-modules”: “3.3.0-2017-10-18-3”.
Hi @tsonevn, are you kidding? Do you really think that September is 9th month (no problem here) and November is 10th?! Should I set
for October then;)