You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue with the normalizeRange function in the inquirer-datepicker codebase. The function subtracts 1 from the month value, which leads to unexpected behavior and "Invalid Date" errors when creating moment objects. This substraction seems unnecessary and incorrect because it converts a correctly indexed month into an incorrect one.
Steps to Reproduce
1- Define a date object with the current month using new Date().getMonth(), which returns a 0-based index for the month.
2- Pass this object to the normalizeRange function.
3- The normalizeRange function subtracts 1 from the month value, resulting in an incorrect month value.
4- Create a moment object with the normalized date object.
The moment object returns "Invalid Date" due to the incorrect month value.
The text was updated successfully, but these errors were encountered:
Hi,
I encountered an issue with the normalizeRange function in the inquirer-datepicker codebase. The function subtracts 1 from the month value, which leads to unexpected behavior and "Invalid Date" errors when creating moment objects. This substraction seems unnecessary and incorrect because it converts a correctly indexed month into an incorrect one.
Steps to Reproduce
1- Define a date object with the current month using new Date().getMonth(), which returns a 0-based index for the month.
2- Pass this object to the normalizeRange function.
3- The normalizeRange function subtracts 1 from the month value, resulting in an incorrect month value.
4- Create a moment object with the normalized date object.
The moment object returns "Invalid Date" due to the incorrect month value.
The text was updated successfully, but these errors were encountered: