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.
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:
Paul Grenier wrote a post about similar problem. He used a JQuery to modify Calendar View. It looks like this:
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: Take a look at this solution http://www.endusersharepoint.com/?p=1223, by Paul Grenier… it could be used to solve your problem.
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)
@Wouter: Which regional settings you are using?
Toni, I’m using dutch (belgium)
@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?
Can you use this method to get the time to display under the date?
@Nick: Sure, try “=TEXT(Created,”hh:mm:ss”)”
in share point portal i want to diaplay only day & Month.. year not required.
If you are in control of the list schema you can set the date format as DateOnly and this will eliminate the time from the views.
But what if you make a calculated field with the formula =TEXT(Created,”dd mmm”). Is it still date sortable like it should be?
@Jo: Nope, it is text field and it will be sorted as text. I think you cannot have both ways OOTB.
This is really very small and effective solution. this solved my problem in seconds.
When I try this for an all day event using the date format suggested, it sets the day as the day before because the start time is 12:00 AM (I’m guessing). I suppose an if statement would work??
I got this to work by creating a new column named Date, selected-Calculated based on other columns, Formula =[Start Time], Set the data type to Date and Time set date format to Date Only. No Syntax error and you can sort in date order
i want to display date like this : Tuesday 14,Feburary 2015 in my display template. what format should i use?
In the column that I’m calculating from I have dates that I entered in manually that are different from the date the entry was made. How do I display that date with that formula instead of the one that I created the entry on?
hi, can some one help me regarding the date and time. Date and time entered in the list are changed in the approval email. I am using this =TEXT([startdatum], “yyyy-mm-dd”) in calculated column but it doesnt wrok. Any idea…..i tried this idea too =TEXT(startdatum,”dd mmm yy”)
I want to create only with date and time in just hours and minutes but i dont need seconds. How do I it? By default even I dont add it manually, it picks up seconds
The calculated column tip worked for me in displaying the date in format “dd mmm yyyy”. However for dates that are blank/null, it displayed “30 Dec 1899”. I want nothing to be displayed if the date is null/empty. Is there a way to do this? Appreciate a helpful reply. Thanks in advance!
You would have to add an IF function to check if date is null and then display empty value or something else. https://support.office.com/en-us/article/if-function-7025be14-5665-43d0-af20-8293d1fe9d3a
Comments are closed.