tuwien-csd / damap-frontend

MIT License
9 stars 9 forks source link

Global: Change date picker to always use utc #209

Closed ValentinFutterer closed 2 weeks ago

ValentinFutterer commented 2 weeks ago

Description

Bugfix

What does this PR do?

Adds providers to datepickers that configure them to use the UTC date format - before they would use the local timezone, which would lead to date jumps, since they were converted to UTC in the backen. E.g. 01.06.2024 00:00 GMT+2 would become 31.05.2024 22:00 UTC.

Code review focus

Test extensively, the bug occured less often on my local machine - so maybe it is not fixed. If it is fixed, remove the code block

{
      provide: DateAdapter,
      useClass: MomentDateAdapter,
      deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
    },
    { provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS },

from the providers array in licenses.module.ts and project.module.ts. I needed these to make it work, but the Angular docs do not mention them.

Checks

closes GH-204

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud