Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix date conversion on the server-side #16841

Merged
merged 1 commit into from
Aug 12, 2024

Conversation

kjac
Copy link
Contributor

@kjac kjac commented Jul 30, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes #16795 (and #16779)

Description

The DateTimeOffset parsing added in #16732 is the root cause of both #16795 and #16779. #16779 was fixed by a client-side change in the 14.1.1 patch, but #16795 still happens in that patch.

By the looks of it, any "date without time" property value saved before 14.1 will not work in 14.1 and 14.1.1 😱

This PR fixes the problem at server level by:

  1. Handling DateTimeOffset > DateTime conversion and vice versa for object types.
  2. Making the value converter for the Date property editor more resilient.

Unit tests have been added to guard against this issue later on.

Testing this

  1. Create a V13 site.
  2. Create some content with:
    • A "date without time" and a "date with time" property at content root level.
    • A block list with elements containing both "date without time" and a "date with time" properties.
  3. Create a frontend rendering that outputs the content values.
  4. Upgrade the site to V14.1.1
  5. Verify that the frontend rendering still works.
  6. Verify that the back-office editing still works.

@Migaroez
Copy link
Contributor

Migaroez commented Aug 5, 2024

Frontend rendering is ok, but the backend seems to have lost it's time picker
image
image

@Migaroez
Copy link
Contributor

Resaving data type applied correct time.

@Migaroez Migaroez merged commit ceddf86 into v14/dev Aug 12, 2024
16 of 17 checks passed
@Migaroez Migaroez deleted the v14/fix/date-conversion-serverside branch August 12, 2024 10:41
Zeegaan pushed a commit that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants