I am trying to customizing a popupTemplate for a FeatureLayer, but when I try and use a date field in the TextContent which has had its FieldInfo format set it is outputted as a long integer which I assume is seconds.
<SPAN class="keyword token">let</SPAN> joinedFields <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">FieldsContent</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
fieldInfos<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN>
<SPAN class="punctuation token">{</SPAN>
fieldName<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"A_Date"</SPAN><SPAN class="punctuation token">,</SPAN>
format<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
dateFormat<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"day-short-month-year"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">let</SPAN> joinedtext <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">TextContent</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
text<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"<h4>Meter Readings</h4>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<table class=\"table-condensed table-striped gw-table-meters\">"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<thead>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<tr><th scope=\"col\">Date</th><th scope=\"col\">Reading</th><th scope=\"col\">Usage</th><th scope=\"col\">Code</th><th scope=\"col\">Days</th><th scope=\"col\">Avg</th></tr></thead>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<tr><td>{A_Date}</td><td>{A_Reading}</td><td>{A_Usage}</td><td>{A_Code}</td><td>{A_No_of_Da}</td><td>{A_UseADay}</td></tr>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<tr><td>{B_Date}</td><td>{B_Reading}</td><td>{B_Usage}</td><td>{B_Code}</td><td>{B_No_of_Da}</td><td>{B_UseADay}</td></tr>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<tr><td>{C_Date}</td><td>{C_Reading}</td><td>{C_Usage}</td><td>{C_Code}</td><td>{C_No_of_Da}</td><td>{C_UseADay}</td></tr>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<tr><td>{D_Date}</td><td>{D_Reading}</td><td>{D_Usage}</td><td>{D_Code}</td><td>{D_No_of_Da}</td><td>{D_UseADay}</td></tr>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<tbody>"</SPAN><SPAN class="operator token">+</SPAN>
<SPAN class="string token">"</tbody></table>"</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">let</SPAN> joinedPopup <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">PopupTemplate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
title<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Joined: {Supply_No}"</SPAN><SPAN class="punctuation token">,</SPAN>
outFields<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">"*"</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
content<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN>joinedFields<SPAN class="punctuation token">,</SPAN>joinedtext<SPAN class="punctuation token">]</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
As you can see from the screen shot above the A_Date is not formatted correctly in the TextContent but is in the FieldsContent.