(function() {
var linkFilenameFiledContext = {};
linkFilenameFiledContext.Templates = {};
linkFilenameFiledContext.Templates.Fields = {
"Date": { "View": linkFilenameFiledTemplate }
};
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(linkFilenameFiledContext);
})();
function linkFilenameFiledTemplate(ctx) {
var currentdate = ctx.CurrentItem["Date"];
if (currentdate != "") {
var date = currentdate.toString().substring(currentdate.lastIndexOf(" "), - 1);
var time = currentdate.toString().substring(currentdate.lastIndexOf(" ") + 1);
return date + "<br>" + time;
}
}
Result: Happy Coding!
No comments:
Post a Comment