seb-oss / green

Green is an open-source design system built by SEB.
https://storybook.seb.io/
Apache License 2.0
31 stars 43 forks source link

Datepicker: Angular datepicker sometimes sets dates incorrectly (month part specifically) #1412

Closed karolis-leonas closed 1 month ago

karolis-leonas commented 1 month ago

Bug already reported?

For which framework/library you are reporting the bug

Angular

Component name

Datepicker

Description

Hello Green team,

We have found out that when using date selector window on Angular datepicker and on some months - dates seem to be set incorrectly. Or to be specific - month part inside those dates are incorrect (set as the one after the expected month). Issue was found both on our project with latest Green packages version and on documentation page here https://storybook.seb.io/latest/angular/?path=/docs/components-datepicker--documentation#datepickeroptions.

Steps To Reproduce

Steps to reproduce were written on 2024-05-31.

  1. Go to https://storybook.seb.io/latest/angular/?path=/docs/components-datepicker--documentation#datepickeroptions page
  2. When datepicker is empty in "Birthday" datepicker select date which is in February 2024 (e.g. February 5 2024) or April 2024 (e.g. April 7 2024) - select those dates by using date selector block and do not use input field: image

Keep in mind that this issue usually appears on initial setting of date (when date is set incorrectly, on second try it seems to be set correctly, although that also might seem unstable) or on specific months (January, March or May looked okay to be set initially),

Current Behaviour

In February test case datepicker shows 05/03/2024 in its input field: image

In April test case datepicker shows 07/05/2024 in its input field: image

Months in input field seem to be later by one than expected.

Expected Behaviour

Datepicker should set dates properly (05/02/2024 and 07/04/2024 respectively).