How to remove the Time from the Project level date custom field on the PDP pages RRS feed

  • Question

  • Hi All,

    Currently date type custom field is showing the Date +Time(3/17/2017 8:00 AM) value for the date custom field. How can I get rid of the time part from the date value to be displayed on the PDPs.

    Please let me know if there is any easy way.

    Thanks in Advance.



    Monday, June 12, 2017 9:37 AM

All replies

  • Hi,

    I'm not sure how to do that. 

    You might want to refer to this similar thread:

    Hope this helps,

    Guillaume Rouyre, MBA, MVP, P-Seller

    Monday, June 12, 2017 9:56 AM
  • Hi Guillaume Rouyre,

    Thanks for your response, the above thread is to change the date format. But my issue here is to get rid of the time part from the DateTime value.



    Monday, June 12, 2017 10:55 AM
  • Hi Raj,

    Did you get any solution for this ?



    Monday, December 17, 2018 6:02 PM
  • Hi Venkat,

    I've written a jQuery code to remove the time part from the dates but that code was working only when the PDP is in edit mode. Have also opened a ticket with Microsoft but they told me that "its a by design issue and we are not going to make this change at this moment . We'll look into it when we make any major changes to the PDPs".

    -Rajkumar Allepu

    Monday, January 28, 2019 8:58 AM
  • Hi,

    following code is currently only working in read-only mode:

    <script type="text/javascript" src="/sites/pwa/Scripts/jquery-2.1.1.min.js"></script> <script type="text/javascript"> //Call main function $(document).ready(ExecuteOrDelayUntilScriptLoaded(MainFunction, "sp.js")); function MainFunction() { //GUID of Custom field FormatElementsByGuid("e5b18193-db22-e911-afa8-00155d7cad15"); } //This function will return the value of Enterprise Custom Field if it is available on the page of a checked-in project function FormatElementsByGuid(guid) { var nodeList = document.getElementsByTagName('*'); var nodeArray = []; var iterator = 0; var node = null; while (node = nodeList[iterator++]) { //Nothing will happen, if field not on page if (node.hasAttribute("guid") && node.outerHTML.startsWith('<div guid="' + guid + '"')) { var date = new Date(node.innerText) node.innerText = date.toLocaleDateString(); } } }


    Perhaps you can combine your code for checked-out and mine for checked-in somehow?


    Monday, January 28, 2019 9:26 AM