Sharepoint 2013 SP1 Personal Blog date and title truncated with title
-
29-09-2020 - |
Question
This personal blog at mysite. For this issues i cannot add customs css right? what i think right now, i want change date formatting become "09 Nov" not "09 November", is that possible ?
Solution
Go to the Posts list of your blog -> list settings -> click on "Created" column, there you schould be able to change the showing date format to "Standard"
OTHER TIPS
Since in SharePoint 2013 Client Side Rendering is a default rendering mode, i would recommend the following approach to set PublishingDate
field format.
The solution is to override the format of PublishingDate
field before rendering the post as demonstrated below:
JavaScript template
SPClientTemplates.TemplateManager.RegisterTemplateOverrides({
ListTemplateType: 301,
OnPreRender: function(ctx) {
var rows = ctx.ListData.Row;
for (var i=0;i<rows.length;i++)
{
var monthString = rows[i]["PublishedDate.MonthDayOnly"];
var monthParts = monthString.split(" ");
monthParts[0] = monthParts[0].substring(0,3);
rows[i]["PublishedDate.MonthDayOnly"] = monthParts.join(" ");
}
}
});
How to apply changes
Probably the easiest way would to insert the specified code into the page using Content Editor
or Script Editor
web parts.
- Open the page in Edit mode
- Add Script Editor web part and insert the provided code by enclosing it using
script
tag - Save the changes
Result