Skip to main content
Skip table of contents

How To Set the Date Format in MDM Search Columns

A key feature of DCM is the utilization of the momentJS library for rendering Date fields. This integration with momentJS brings a wealth of capabilities to the DCM platform, specifically in the realm of handling and displaying dates.

MomentJS is a widely-used JavaScript library that simplifies working with dates and times. It provides a comprehensive set of functions for parsing, manipulating, and formatting dates and times. By leveraging momentJS within DCM, users gain the ability to precisely control how date and time information is presented to them and others interacting with the platform.

To facilitate this, momentJS employs a set of format codes that determine how dates and times are formatted when displayed. These codes act as placeholders, dynamically filling in the corresponding date and time components based on the specified format. Eccentex provides users with a link to the moment.js format codes documentation, found at https://momentjs.com/docs/#/displaying/format/. This documentation serves as a reference guide, detailing the various format codes that can be used to achieve specific date and time representations.

This documentation allows DCM users to customize how dates are displayed according to their preferences or specific requirements. This level of flexibility enhances the user experience and ensures that the presentation of date-related information aligns with the needs of the business processes being managed within the DCM platform.


Setting a Predefined Date Format

  1. Open the Search Builder.
  2. Select the Date field you need to configure a Date render.
  3. Select the Edit action for the Date field. In our example, we chose the Created Date field for simplicity.
  4. Expand the dropdown list for the Date Format property (1), and select any pre-configured format (2). In our example, we select the Full DateTime ("dddd, MMMM Do YYYY, h:mm:ss a").
  5. Apply the changes to the property.
  6. Save the search and do a Preview to validate the format.

Setting a Custom Date Format

  1. Open the Search Builder.
  2. Select the Date field you need to configure a custom Date render.
  3. Select the Edit action for the Date field. In our example, we chose the Modified Date field for simplicity.
  4. Insert the following code in the Custom Renderer property.

    JS
    function (value, metaData, record) {
        var dateFormat = 'MM dd hh',
            v_date = new Date(value);
        return moment(v_date).format(dateFormat);
    }

  5. Apply the changes to the property.

  6. Save the search and do a Preview to validate the new Date format render.

Setting a Relative Time Date Format

  1. Open the Search Builder.
  2. Select the Date field you need to configure a custom Date render.
  3. Select the Edit action for the Date field. In our example, we chose the Due Date field for simplicity.
  4. Insert the following code in the Custom Renderer property.

    JS
    function (value, metaData, record) {
            v_date = new Date(value);
        return moment(v_date).toNow();
    }

  5. Apply the changes to the property.

  6. Save the search and do a Preview to validate the new Date format render.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.