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

Updated the IsoDateTimeConverter initialization in the JsonDateTimeFo… #14400

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

miguelcrpinto
Copy link
Contributor

Prerequisites

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

Fix for issue 14306

Description

Updated the IsoDateTimeConverter initialization in the JsonDateTimeFormatAttribute to set the Culture to InvariantCulture so that the custom DateTime format symbols ( date and time separators) are respected independent of the CurrentCulture being used.

This can be tested by setting the back office language to Danish ("da-DK") and inspecting the response of the Get By Id API (/umbraco/backoffice/umbracoapi/content/GetById?id={node id}). Previously any date time properties were being serialized having . as time separator (example: 13.25.00) and now are being serialized with the format defined in the JsonDateTimeFormatFilter ("yyyy-MM-dd HH:mm:ss")

…rmatAttribute to set the Culture to InvariantCulture so that the custom DateTime format symbols ( date and time separators) are respected independent of the CurrentCulture being used.
@github-actions
Copy link

github-actions bot commented Jun 17, 2023

Hi there @miguelcrpinto, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@emmagarland
Copy link
Contributor

@miguelcrpinto Thanks so much for creating this PR to fix the issue when scheduled publishing in Danish.

I will look at this soon, and then we can get it merged in!

Best

Emma

@emmagarland
Copy link
Contributor

Hi @miguelcrpinto

Just to let you know, I've tested and verified that your fix does resolve the scheduled publishing issue in Danish (and possibly some other unknown date culture scenarios, too). Great stuff! 👍

Due to the scope of the change, we're just discussing this with HQ to make sure there aren't other scenarios or impacts to consider for this change (since the attribute affects quite a few areas by the fact it is an attribute).

We'll get back to you ASAP about this!

Thanks,

Emma

@emmagarland emmagarland added state/needs-investigation This requires input from HQ or community to proceed type/bug category/umbraco-cms labels Jun 19, 2023
@miguelcrpinto
Copy link
Contributor Author

@emmagarland as far as I could see (via "find all references" in Visual Studio), this attribute was only used in the Content controller. This should not affect any other areas because this was producing the intended format for all the other backoffice languages. In any case, it's always a good idea to double check with HQ :)

@emmagarland
Copy link
Contributor

emmagarland commented Jun 20, 2023

Thanks @miguelcrpinto! And for the documentation on the issue #14306.

I am just speaking with HQ to find out if we can merge this in soon,

Best regards

Emma

@emmagarland emmagarland added release/12.1.0 and removed state/needs-investigation This requires input from HQ or community to proceed labels Jun 20, 2023
@emmagarland emmagarland merged commit 4d63b3c into umbraco:contrib Jun 20, 2023
@emmagarland emmagarland linked an issue Jun 20, 2023 that may be closed by this pull request
@emmagarland
Copy link
Contributor

Hi @miguelcrpinto, thanks so much for your pull request to fix the issue where scheduled publishing fails in Danish, #14306

It has now been successfully merged! 🙌

Thanks for your help with this one, it is a great fix.

Best wishes

Emma

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish scheduling fails when users language is set to Danish
4 participants