1

How can I change the display format from friendly to standard?

I want to change this on all lists in the solution

enter image description here

$sites = Get-SPSite "http://company.com/sites/testdelete/"
$created = "Created"

foreach ($spsite in $sites)
{
  $sitelists = foreach ($web in $spsite.AllWebs) 
  {
    foreach($list in $web.lists)
    { 
       foreach($list in $web.lists)
       { 
           $column = $list.Fields[$created]
           $column.FriendlyDisplayFormat = "Disabled"
           $column.Update()

       }
    }
  }
#$sitelists |select Title
}
3
  • Can you give an example of how Standard format looks? Also which column you want to change? Oct 30, 2014 at 11:39
  • If you choose to use friendly, then all lists will be formated (date) like facebook. (yesterday, today, 6 min ago..) . I only want to change this setting from friendly to standard
    – Plexus81
    Oct 30, 2014 at 11:46
  • 1
    Try setting the property to 1, $column.FriendlyDisplayFormat = 1. This is enumeration as we can see here: SPDateTimeFieldFriendlyFormatType enumeration Oct 30, 2014 at 14:04

2 Answers 2

3

Try setting the property to 1

$column.FriendlyDisplayFormat = 1

This is enumeration type as we can see here: SPDateTimeFieldFriendlyFormatType enumeration

0

This method worked for me.

$column.FriendlyDisplayFormat = [Microsoft.SharePoint.SPDateTimeFieldFriendlyFormatType]::Disabled

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.