Article
Can we set up displaying of a post date in the Feed without specifying "today, yesterday, the day before yesterday"?
16:40 Jul 02, 2018
Question
Can we set up displaying of a post date in the Feed without specifying "today, yesterday, the day before yesterday"?
Answer
Override the getCreatedOnText() method of the SocialFeedUtilities module. Since you cannot extend modules in bpm'online (you can only replace them completely), create a replacing client module in the custom package and specify SocialFeedUtilities as the parent modue. Copy the text from a similar module in the ESN package (the "Source code and "LESS" tabs) and change the text of the getCreatedOnText method to:
getCreatedOnText: function() { var cultureSetting = Terrasoft.Resources.CultureSettings; var value = this.get("CreatedOn"); if (value) { var datePart = Ext.Date.dateFormat(value, cultureSetting.dateFormat); var timePart = Ext.Date.dateFormat(value, cultureSetting.timeFormat); return Ext.String.format("{0} {2} {1}", datePart, timePart, FormatUtilsResources.localizableStrings.In); } return ""; }
At the very beginning of the text, add the dependency of the module from FormatUtilsResources to have access to the FormatUtilsResources.localizableStrings.In localized string of the FormatUtils module:
define("SocialFeedUtilities", ["FormatUtilsResources", "ESNFeedUtils", "ESNFeedModuleResources", "FormatUtils", "ESNConstants", "NetworkUtilities", "ModalBox", "ServiceHelper", "MaskHelper", "performancecountermanager", "css!SocialFeedUtilities"], function(FormatUtilsResources, ESNFeedUtils, resources, FormatUtils, ESNConstants, NetworkUtilities, ModalBox, ServiceHelper, MaskHelper, performanceManager) {...