How to Disable Meta Format-Detection on iOS for Dates

HTML Email iOS format-detection

Yes, there is. You can use:

  • Date: <meta name="format-detection" content="date=no">
  • Address: <meta name="format-detection" content="address=no">
  • Email: <meta name="format-detection" content="email=no">

Combining them:

<meta name="format-detection" content="telephone=no">
<meta name="format-detection" content="date=no">
<meta name="format-detection" content="address=no">
<meta name="format-detection" content="email=no">

Removing date/time styling from HTML email iPhone

I managed to get this working by tricking the date detection algorithm into thinking it's not dealing with a date by inserting a zero width character in between my date/time strings e.g:

<h4 style="font-size: 16px;color: #FFFFFF !important; text-decoration:none !important;font-family: Arial;font-weight: bold;padding: 0;margin: 0;text-align: left;line-height: 1.3;word-break: normal;" class="appleLinksWhite">
Thursday​ 20th​ November​
</h4>

<p style="color: #FFFFFF !important; text-decoration:none !important;margin: 0;margin-bottom: 0;font-family: Arial;font-weight: normal;padding: 0;text-align: left;line-height: 19px;font-size: 14px !important;" class="appleLinksWhite">
10:45am​ until​ 12:30pm​,<br>The Feast, Suffolk Food Hall, Ipswich
</p>

Stop iPhone from turning date/time into links

Well after just trying out various things, I found the answer. Note that using spans and such are not a great idea and in some cases don't work due to the automatic creation of links on certain elements.

A way around it is the apply inline styling to the anchor tag that has the webcal type in the href attribute which formats it appropriately.

<a href="webcal:#" style="color: #ffffff; text-decoration: none;">

Whilst this doesn't stop it from becoming a link, it allows you to make the link the same colour and also have more control over the text.

The date/time detection isn't defined in Apple's developer support docs anyway. Only telephone number is (which can also be overcome by using tel).

Phone Links - Apple Developer Support Docs

In fairness this would have been very easy to overcome however the Mail for iOS app works in a very different way to normal browsers, even mobile Safari.

This also did not work;

.class a {
color: #ffffff;
text-decoration: none;
}

Email HTML sucks, a lot.



Related Topics



Leave a reply



Submit