SharePoint Use Cases

07 Jan, 2009

Customizing DateTime format on a list view web part

Posted by: Toni Frankola In: sharepoint  Bookmark and Share

In order to make SharePoint really functional sometimes little things count. Few weeks ago a customer wanted to display only Date partition of Created value in a list view web part.

Let’s say I want to display a list of “My Active Tasks” on a list web part.

m1

The time partition of the information is irrelevant for this web part. Time is just using space we need to display Title.

SharePoint does not allow you to format the output in a list view web part. Here is a little trick on how to fix that.

    • Create a new calculated column for your list (single line of text)
    • Use the following formula to calculate its value
      =TEXT(Created,"dd mmm yy")

      Use the new column to display in your list. It will look like this one:

      m2

      Paul Grenier wrote a post about similar problem. He used a JQuery to modify Calendar View. It looks like this:




      Comments

      2 | backtrack

      February 5th, 2009 at 3:38 am

      Avatar

      Hi,
      I’d like to have displayed on the calendar view the Creator (Created By) and another field like Location.
      The problem is that is not possible to choose Created By in a calculated column.

      andrew

      3 | Toni

      February 6th, 2009 at 1:37 pm

      Avatar

      @Andrew: Take a look at this solution http://www.endusersharepoint.com/?p=1223, by Paul Grenier… it could be used to solve your problem.

      4 | Wouter

      February 13th, 2009 at 5:05 am

      Avatar

      I tried this, but I get this message every time:

      The formula contains a syntax error or is not supported. at Microsoft.SharePoint.Library.SPRequestInternalClass.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd)
      at Microsoft.SharePoint.Library.SPRequest.AddField(String bstrUrl, String bstrListName, String bstrSchemaXml, Int32 grfAdd)

      Any ideas?

      5 | Toni

      February 14th, 2009 at 11:11 am

      Avatar

      @Wouter: Which regional settings you are using?

      6 | Wouter

      March 2nd, 2009 at 5:26 am

      Avatar

      Toni, I’m using dutch (belgium)

      9 | Toni Frankola

      March 14th, 2009 at 5:59 am

      Avatar

      @Wouter: I just tried it with Croatian and Dutch (Belgium) regional settings and it works. Maybe something else is missing? Can you save your list as template as send it to me?

      Comment Form


      About

      Real-life use case and opinions about collaboration, CRM and web technologies and stuff by Toni Frankola. More...

      Categories

      All postings on this blog are provided "AS IS" with no warranties, and confer no rights. All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer.