Hi all,
I am creating a popup programmatically and it works fine but I am not sure how to not return the default computer date value of "december 31st 1969" when date is empty. I started with an if statement line 7 but not too sure how to return a "No Value" if no date value in th epopup. Any idea?
<SPAN class="keyword token">function</SPAN> <SPAN class="token function">getTextContent</SPAN><SPAN class="punctuation token">(</SPAN>graphic<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> phone <SPAN class="operator token">=</SPAN> graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>Public_Contact<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> rs <SPAN class="operator token">=</SPAN> graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>BLOCKNM<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> comment <SPAN class="operator token">=</SPAN> graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>COMMENT<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> fc <SPAN class="operator token">=</SPAN> graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>FULLCLOSE<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> Loc <SPAN class="operator token">=</SPAN> graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>LOCDESC<SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN>graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>Estimated_End <SPAN class="operator token">==</SPAN> <SPAN class="string token">""</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
content <SPAN class="operator token">+</SPAN><SPAN class="operator token">=</SPAN> <SPAN class="string token">"<br/><b>No Value</b>"</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">var</SPAN> lastupdated <SPAN class="operator token">=</SPAN> locale<SPAN class="punctuation token">.</SPAN><SPAN class="token function">format</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Date</SPAN><SPAN class="punctuation token">(</SPAN>graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>LASTUPDATE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
selector<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'date'</SPAN><SPAN class="punctuation token">,</SPAN>
datePattern<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'MMMM d, y'</SPAN><SPAN class="punctuation token">,</SPAN>
time<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"h:m:s.SSS a z"</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">var</SPAN> eed <SPAN class="operator token">=</SPAN> locale<SPAN class="punctuation token">.</SPAN><SPAN class="token function">format</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Date</SPAN><SPAN class="punctuation token">(</SPAN>graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>Estimated_End<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
selector<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'date'</SPAN><SPAN class="punctuation token">,</SPAN>
datePattern<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'MMMM d, y'</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">var</SPAN> starts <SPAN class="operator token">=</SPAN> locale<SPAN class="punctuation token">.</SPAN><SPAN class="token function">format</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Date</SPAN><SPAN class="punctuation token">(</SPAN>graphic<SPAN class="punctuation token">.</SPAN>attributes<SPAN class="punctuation token">.</SPAN>STARTDATE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
selector<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'date'</SPAN><SPAN class="punctuation token">,</SPAN>
datePattern<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">'MMMM d, y'</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">return</SPAN> <SPAN class="string token">"<b>Road Status: </b>"</SPAN> <SPAN class="operator token">+</SPAN> rs <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<br>"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<b>Comments: </b>"</SPAN> <SPAN class="operator token">+</SPAN> comment <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<br>"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<b>Full Closure: </b>"</SPAN> <SPAN class="operator token">+</SPAN> fc <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<br>"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<b>Location: </b>"</SPAN> <SPAN class="operator token">+</SPAN> Loc <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<br>"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<b>Starts: </b>"</SPAN> <SPAN class="operator token">+</SPAN> starts <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<br>"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<b>Estimated End Date: </b>"</SPAN> <SPAN class="operator token">+</SPAN> eed <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<br>"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<b>Public Contact Information: </b>"</SPAN> <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<a href=tel:"</SPAN> <SPAN class="operator token">+</SPAN> phone <SPAN class="operator token">+</SPAN> <SPAN class="string token">">"</SPAN> <SPAN class="operator token">+</SPAN> phone <SPAN class="operator token">+</SPAN> <SPAN class="string token">"</a><br>"</SPAN> <SPAN class="operator token">+</SPAN>
<SPAN class="string token">"<b>Last Updated: </b>"</SPAN> <SPAN class="operator token">+</SPAN> lastupdated <SPAN class="operator token">+</SPAN> <SPAN class="string token">"<br>"</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></SPAN><SPAN></SPAN></SPAN>