R_o_n_
Mar 08, 2024Copper Contributor
Column formatting & dates
Can anyone support in this little piece of column formatting? {
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent...
- Mar 09, 2024
R_o_n_ Try using JSON like:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "=toLocaleDateString(Date((getMonth([$DateOfBirth])+1) + '/' + getDate([$DateOfBirth]) + '/' + getYear(@now))) + ' | ' + toLocaleDateString(@now)", "style": { "color": "=if(Date((getMonth([$DateOfBirth])+1) + '/' + getDate([$DateOfBirth]) + '/' + getYear(@now)) < @now, 'red', 'green')" } }
Output:
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.