Forum Discussion
Clause9
Jun 13, 2023Copper Contributor
Yet Another Conditional Formatting Query
Hey folks, I have an SP list with 3 relevant columns - IssueDate, ReviewFrequency, and NextReview. IssueDate is for manual date entry, ReviewFrequency is a choice of N/A, 3, 6, 12, 24, 36. NextRe...
SvenSieverding
Jun 13, 2023Bronze Contributor
Hi Clause9 ,
You can use the toLocaleDateString function to format a column in the date format of your locale.
=toLocaleDateString(@currentField)Make sure that your calculated column "NextReview" returns the data type "date".
Alternatively you can use the "getMonth", "getDate" and "getYear" functions to build your own format
=getMonth(@now)+1)+'.'+getDate(@now)+'.'+getYear(@now)
If you want to compare two dates you can use the "Number" function if you don't want to compare dates directly. It returns the number of milliseconds since ???
Number(@currentField)>Number(@now)
Best Regards,
Sven
Clause9
Jun 13, 2023Copper Contributor
Hi Sven and thanks for the very swift response. All sorted but quite strange 🙂
Good old ChatGPT suggested using toLocaleDateString in the JSON, I tried it and it didnt work - it actually removed the conditional formatting that had worked.
Removed and saved back to JSON that uses toDateString. I still had the error so thought I'd add another calculated column to validate what the other columns were returning - when i added the column, all formatting started working "properly". Have now removed column and its still working..
Modern technology never fails to confuse me 🙂
Good old ChatGPT suggested using toLocaleDateString in the JSON, I tried it and it didnt work - it actually removed the conditional formatting that had worked.
Removed and saved back to JSON that uses toDateString. I still had the error so thought I'd add another calculated column to validate what the other columns were returning - when i added the column, all formatting started working "properly". Have now removed column and its still working..
Modern technology never fails to confuse me 🙂