SAP / fundamental-ngx

Fundamental Library for Angular is SAP Design System Angular component library
https://sap.github.io/fundamental-ngx
Apache License 2.0
263 stars 126 forks source link

Dayjs strict mode showing local date not UTC #12258

Open markywilson opened 1 month ago

markywilson commented 1 month ago

Is this a bug, enhancement, or feature request?

Describe your proposal.

Can you handle that on the application side

No

Which versions of Angular and Fundamental Library for Angular are affected? Please, specify the exact version. (If this is a feature request, use current version.)

Latest version https://sap.github.io/fundamental-ngx/#/core/dayjs-datetime-adapter

If this is a bug, please provide steps for reproducing it; the exact components you are using;

Please provide relevant source code (if applicable).

It's working as expected using Moment adaptor https://sap.github.io/fundamental-ngx/#/core/moment-datetime-adapter Screenshot 2024-08-13 at 16 39 39

Please provide stackblitz example(s).

In case this is Accessibility related topic, did you consult with an accessibility expert? If not, please do so and share their recommendations.

Did you check the documentation and the API?

Yes

Did you search for similar issues?

Might be related to/caused by #10230

Is there anything else we should know?

IMPORTANT: Please refrain from providing links or screenshots of SAP's internal information, as this project is open-source, and its contents are accessible to anyone.

khotcholava commented 3 weeks ago

@markywilson Please include stackblitz example. And detailed step how to reproduce it.

markywilson commented 3 weeks ago

Hi @khotcholava, The steps are provided in the description and the issue could be reproduced using the example on the documentation page https://sap.github.io/fundamental-ngx/#/core/dayjs-datetime-adapter

khotcholava commented 3 weeks ago

@markywilson Did not understand what is the problem there.

markywilson commented 3 weeks ago

@khotcholava

We have a datetime picker that allows our app customers to select a date and time in UTC. In the screenshots you would notice the following: My Local Date was Wed Aug 14 (GMT +10)

Using the deprecated Moment Adapter in UTC mode, the selected date was Tue Aug 13 (in UTC) -> This works as expected Screenshot 2024-08-13 at 16 39 39

However using the DayJS adapter in UTC mode, the selected date was Wed Aug 14 -> Not in UTC Screenshot 2024-08-13 at 16 39 59