0

I have a calculated column [Due date] with a simple formula, =[Event date]+13, and it's set to The data type returned from this formula is: Date and Time.

However, it doesn't have the Display Format: Standard / Friendly option that ordinary non-calculated Date and Time columns have. And I'd like it to use that friendly format.

Has anyone ideas for applying SharePoint's friendly date formatting to a calculated date column - e.g., with JSON column formatting, with something in the column's formula etc? I've seen some PowerShell snippets about friendly date formats but I'm hoping for something easier to manage.

Much obliged for any and all feedback!

2 Answers 2

0

Create Due Date as Date & Time field instead of calculated field then updated due date field my Workflow or MS flow using that using can display Friendly date time format in due date

1
  • Thanks, Bharat - great suggestion. I already have a Flow that runs a few tasks when a new item is created in that list, so adding a new step to update a new [Due date] column of type Date and Time works fine. The function I used was addDays(convertTimeZone(utcNow(), 'UTC', 'China Standard Time'),13)' under a new Flow step, SharePoint - Update item.
    – Adrian
    Commented Nov 6, 2019 at 6:54
1

You can use toLocaleDateString() function/operator in Column formatting to convert your date in friendly format.

According to official documentation,

toLocaleDateString(): returns a language sensitive representation of just the date portion of a date

"txtContent":"=toLocaleDateString(@now)" ---> results vary based on user's locale, but en-us looks like "2/5/2019"

2
  • Hi Ganesh, thanks for your quick reply. I've tested that and unfortunately that doesn't reproduce the Friendly format, which should return "Today," "Tomorrow," "Saturday" etc for dates close to the underlying date data.
    – Adrian
    Commented Nov 6, 2019 at 4:26
  • There is no way showing "Today", "Tomorrow" or "Saturday" using Calculated column or JSON Formatting. You can achieve date only in simple dd/mm/yyyy or mm/dd/yyyy format. Commented Nov 6, 2019 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.