-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
…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.
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:
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 🤖 🙂 |
@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 |
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 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 :) |
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 |
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 |
Prerequisites
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")