plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[@nativescript/datetimepicker] Android Datepicker returns March when February is selected

Open syahnur197 opened this issue 5 years ago • 3 comments

As mentioned in the title, when we select the month as february, march is returned regardless of the date and the year. We have updated and downgraded the version of the plugin, but the bug still persist

This is the code that we have

DateTimePicker.pickDate({​​​​​​​​
    context:args.object._context,
    title:global.dateTimePickerTitle(),
      }​​​​​​​​)
        .then((result) => {​​​​​​​​
            // "2021-03-27T16:00:00.000Z" is returned instead of "2021-02-27T16:00:00.000Z" when we selected 27 february 2021
            console.log(JSON.stringify(result)); 
        });

syahnur197 avatar Dec 29 '20 08:12 syahnur197

JSON.stringify returns the date in UTC format. I've tried to reproduce this bug, but with my settings works as expected. Maybe your computer's (android emulator/device) time settings are not valid.

janoshrubos avatar Feb 01 '21 14:02 janoshrubos

I got the same behavior yesterday. I came to open exactly the same issue.

@janoshrubos Curiously because it's February 1st, you can't reproduce it anymore, now you must to use 2023 as your year in the calendar

Steps to reproduce:

  • Select any date in January e.g. 31, apply (31/01/2023)
  • Open the date dialog again starting with your last choice (31/01/2023)
  • Select February's 1st, apply (01/02/2023)
  • Your result will be March's 1st (01/03/2023)
  • But now, if you try to select February 1st starting at (01/03/2023) you will be allowed to do it

In my case, when you select a February day but your start date is after then, it work, but when are you in January and try to select a date in February, you get the bug.

Thank you @syahnur197 to open the issue

luiguild avatar Feb 01 '22 08:02 luiguild

I have the same problem with September. If i select a september date it show october. Other months are right.

cristiandaulisio avatar Aug 31 '23 12:08 cristiandaulisio