How can we help you today?

How to Change the Default Date Format of a Connected Design Element to the European Date Format

When you connect a Design Element to an RSS Feed, the default date format is in ISO:


default ISO date format


This article will demonstrate how to change the default date format to the European format using JavaScript code:


European date format


TABLE OF CONTENTS


Prerequisites


Interactive Tutorial


Before starting the interactive tutorial, copy the code below:

return formatDatesToEuropean(data);

// Function to convert ISO date to European format (DD/MM/YYYY)
function toEuropeanFormat(dateString) {
  const date = new Date(dateString);
  const day = String(date.getDate()).padStart(2, '0');
  const month = String(date.getMonth() + 1).padStart(2, '0');
  const year = date.getFullYear();
  return `${day}/${month}/${year}`;
}

// Transform the data using map
function formatDatesToEuropean(data) {
  return data.map(item => ({
    ...item,
    Date: toEuropeanFormat(item.Date),
    PublishDate: toEuropeanFormat(item.PublishDate),
    LastUpdatedDate: toEuropeanFormat(item.LastUpdatedDate)
  }));
}



Step-by-step Tutorial

Follow the detailed guide below to transform the date format of a connected Design Element:


Step 1: Edit the ShortPoint Web Part

  • Go to the SharePoint page you want to use and click Edit:


Edit


  • Close the Toolbox:


close icon


  • Edit the ShortPoint web part:


Edit properties icon


Step 2: Edit the Connected Design Element


NOTEYou must already have a Design Element connected to an RSS Feed on your SharePoint site. For this guide, we’ll use Icon List. If you don’t have one yet, check out How to Display Your RSS Feed in SharePoint Using the RSS Feeds Connection.
  • Click the EasyPass tag of the connected Design Element:


EasyPass tag


  • Select the cogwheel icon:


cogwheel icon


Step 3: Copy the Code

  • Copy the JavaScript below:
return formatDatesToEuropean(data);

// Function to convert ISO date to European format (DD/MM/YYYY)
function toEuropeanFormat(dateString) {
  const date = new Date(dateString);
  const day = String(date.getDate()).padStart(2, '0');
  const month = String(date.getMonth() + 1).padStart(2, '0');
  const year = date.getFullYear();
  return `${day}/${month}/${year}`;
}

// Transform the data using map
function formatDatesToEuropean(data) {
  return data.map(item => ({
    ...item,
    Date: toEuropeanFormat(item.Date),
    PublishDate: toEuropeanFormat(item.PublishDate),
    LastUpdatedDate: toEuropeanFormat(item.LastUpdatedDate)
  }));
}

Step 4: Open the Connection Window

  • Go to the Connected tab.
  • Click Configure to open the connection window:


configure


Step 5: Paste Code

  • Select Disconnect:


Disconnect


  • Scroll down and expand Advanced Settings:


Advanced Settings


  • Toggle on Enable Advanced Settings.
  • Look for Map Results and paste the code in the field provided:


paste code


  • Click Connect.

Step 6: Save

  • Click Preview to see how the Design Element looks.
  • Update your changes.
  • Click the green checkmark.
  • Click the eye icon to see your page in real-time:


eye icon


  • Save your edits:


Save


Congratulations! You’ve successfully changed the date format to the European date format.


Related articles:

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 33 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more