[@nativescript/datetimepicker] Android Datepicker returns March when February is selected
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));
});
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.
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
I have the same problem with September. If i select a september date it show october. Other months are right.