Skip to content

Android: DatePicker shows wrong month #4851

Description

@terreb

Tell us about the problem

For 9th and 10th months DatePicker shows October.

screen shot 2017-09-19 at 6 12 10 pm

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>

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions