cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThomasH
Helper III
Helper III

Format time in HTML table

Hello, I am having an HTML table created with a date, but I would like the date to be formatted differently so that it is displayed in German format as DD-MM-YYYY, how can I achieve this. In addition, if the date is greater than the current date, I would like it to be colored or highlighted in red, how could I implement this? Thanks

 

ThomasH_0-1662623705723.png

 

26 REPLIES 26

In the email you should not be using the output of the HTML table. But the output of the compose action which replaces the special characters.

@Paulie78  I have update my last Post ,

i use in the Outlook Body this 

ThomasH_1-1664302407924.png

this is from the compose.

The Email contains this

ThomasH_0-1664303569709.png

 

 

Is this right?

ThomasH_3-1664302583543.png

 

 

 

ThomasH
Helper III
Helper III

@Paulie78  Hi,

can you tell me what my fault?

I cannot see where you have gone wrong easily. But if you want I will take a quick look for you on teams. I am sure we can sort it out within a few minutes. Send me a PM if you want to do that.

@Paulie78 I have write you a PM

 

Thank you

Hello, unfortunately I still could not solve the problem.

I use the code of @Paulie78 from Post 19 to create the HTML Table

if
(
  greater(if(equals(item()?['dueDateTime'], null), '', formatDateTime(item()?['dueDateTime'],'dd-MM-yyyy')), utcNow()), 
  concat('<span style="color:red">', item()['dueDateTime'], '</span>', item()['dueDateTime']),
  if(equals(item()?['dueDateTime'], null), '', formatDateTime(item()?['dueDateTime'],'dd-MM-yyyy'))
)

 but the "Fällig" dosen't be red if the Value is greater then today.

ThomasH_0-1666982824334.png

 

 

In the next step "Verfassen" i use this code from @Paulie78 from Post 10 

replace(replace(replace(body('HTML-Tabelle_erstellen'), '&lt;', '<'), '&quot;', '"'), '&gt;', '>')

ThomasH_1-1666982844697.png

and then i create my Email

with this code 

<html>
<head>
  <style> 
table, th {
    border:1px solid black;        
}
td {
    border:1px solid black;
    text-align:left;
    width:20%;
}
  </style>
</head>
<body>
@{outputs('Verfassen')}<br>
<strong>Bearbeitungsstatus:<br>
0 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=Nicht begonnen<br>
50 &nbsp;&nbsp;&nbsp;=in Bearbeitung</strong><br>
<strong>100 = Abgeschlossen</strong><br>
</body>
</html>

"Ausgabe" is from "Verfassen"

ThomasH_2-1666982906791.png

 

then i become a Email, but as I wrote, the due date is not marked in red if the date is later than the current date and the individual fields in the table are not filled correctly as can be seen in the picture.

ThomasH_3-1666983317486.png

 

Who is my fault, and how i can correct it?

 

Thank you for your help.

 

 

ThomasH
Helper III
Helper III

Anybody a Tip for me?

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (1,719)