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
}
  • Can you give an example of how Standard format looks? Also which column you want to change? – Amal Hashim Oct 30 '14 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 '14 at 11:46
  • 1
    Try setting the property to 1, $column.FriendlyDisplayFormat = 1. This is enumeration as we can see here: SPDateTimeFieldFriendlyFormatType enumeration – Arsalan Adam Khatri Oct 30 '14 at 14:04
3

Try setting the property to 1

$column.FriendlyDisplayFormat = 1

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

| improve this answer | |
0

This method worked for me.

$column.FriendlyDisplayFormat = [Microsoft.SharePoint.SPDateTimeFieldFriendlyFormatType]::Disabled
| improve this answer | |

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.