Oct 10 2022 12:17 PM
Oct 10 2022 12:17 PM
In list 1 I am using a date field with out-of-the-box conditional formatting (green-yellow-red) of this column. Regional settings of the site are Dutch: dd-mm-yyyy. Everything works fine.
Next step; I am using this date field in another list on the same site with same regional settings. The date is an extra field from a lookup column. When I paste the JSON from the date field in the first list in this second list, all dates format correctly, even though it is a lookup field. Happy me, but...
Things go wrong when the day of the date is a number >12. The conditional formatting of this lookup column is using mm-dd-yyyy for some reason. I have checked it by lowering the day of that date to a number <12 and it turns into a conditional color (expected behaviour).
How to correct this?
Oct 10 2022 12:33 PM
Oct 10 2022 11:35 PM
@VJK22 It might be using UTC time default date format of mm-dd-yyyy in extended lookup columns.
Check if toLocaleDateString() operator in JSON formatting helps you to convert date column based on user's locale.
Documentation: json-formatting-syntax-reference
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.