You must encode/escape markup characters & < > in text content
appropriately:
&
<
>
In _this_ context, the "&" character should be escaped, although this is
a matter of principle and validity rather than a practical issue (unless
the page is really served with an XHTML media type). Browsers will in
practice process the data in the intended way, since although they will
try to interpret &EndDate as an entity reference, that will (presently)
fail, so they take it literally.
But the reason is not that it is in "text content", and it's not even in
text content under normal definitions (but in an attribute value). The
reason is that it is HTML. If the window.open() invocation were in a
separate JavaScript file, used via <script src="..."></script>, it would
be unnecessary and incorrect (and would surely cause problems) to escape
the "&".
Similarly, in _HTML_, whether in element content or in a attribute
value, the "<" character should be escaped (when it is not meant to be
the first character of a tag).
There is never any other reason to escape ">" than for symmetry with
escaping "<". Oh... wait... well, you _can_ write
<p title=foo>bar>xxx</p>
according to the HTML5 drafts and browser practice, and _here_ you can't
just use ">" instead of ">", as
<p title=foo>bar>xxx</p>
would be taken so that the first ">" ends the tag. But even here,
escaping the ">" is not necessary, in the sense that you can use
quotation marks instead:
<p title="foo>bar">xxx</p>