<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to handle Date&#x2F;Time values in JSRender on JSReports]]></title><description><![CDATA[<p>I am processing from JSON feed a DateTime field using JSRender {{:DateOccurred}} in the output PDF.<br />
It shows 2017-01-31T00:00:00, How do I handle it just it show dd/MM/yyyy only?</p>
<p>Many thanks</p>
]]></description><link>https://forum.jsreport.net/topic/198/how-to-handle-date-time-values-in-jsrender-on-jsreports</link><generator>RSS for Node</generator><lastBuildDate>Tue, 19 May 2026 03:35:08 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/198.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 24 Jul 2017 20:02:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to handle Date&#x2F;Time values in JSRender on JSReports on Invalid Date]]></title><description><![CDATA[<p>I am processing from JSON feed a DateTime field using JSRender {{:DateOccurred}} in the output PDF.<br />
It shows 2017-01-31T00:00:00, How do I handle it just it show dd/MM/yyyy only?</p>
<p>Many thanks</p>
]]></description><link>https://forum.jsreport.net/post/896</link><guid isPermaLink="true">https://forum.jsreport.net/post/896</guid><dc:creator><![CDATA[Carl Blanchard]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How to handle Date&#x2F;Time values in JSRender on JSReports on Mon, 24 Jul 2017 20:15:39 GMT]]></title><description><![CDATA[<p>you can make a <a href="http://www.jsviews.com/#helpers" rel="nofollow">jsrender helper</a> that takes the datetime field and returns a string with your desired format.</p>
<p>and inside your helper you can write your own <a href="https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date" rel="nofollow">logic to convert a date to a format</a> or you can use a library like <a href="http://momentjs.com/" rel="nofollow">moment</a> or <a href="https://date-fns.org/" rel="nofollow">date-fns</a></p>
]]></description><link>https://forum.jsreport.net/post/897</link><guid isPermaLink="true">https://forum.jsreport.net/post/897</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Mon, 24 Jul 2017 20:15:39 GMT</pubDate></item><item><title><![CDATA[Reply to How to handle Date&#x2F;Time values in JSRender on JSReports on Invalid Date]]></title><description><![CDATA[<p>Revisiting this. Never did get it to work<br />
Following the example on  <a href="https://www.jsviews.com/#helpers" rel="nofollow">https://www.jsviews.com/#helpers</a><br />
give me this exception event so I've copied and pasted the example</p>
<p>Error occured - Error during rendering report: view.hlp(...) is not a function<br />
Stak - TypeError: view.hlp(...) is not a function<br />
at Function.eval [as fn] (eval at buildCode ([eval]:127512:10), &lt;anonymous&gt;:39:24)<br />
at renderWithViews ([eval]:126864:18)<br />
at Function.renderContent [as render] ([eval]:126719:13)<br />
at [eval]:477:19<br />
at evalmachine.&lt;anonymous&gt;:1:41<br />
at ContextifyScript.Script.runInNewContext (vm.js:18:15)<br />
at Object.exports.runInNewContext (vm.js:49:17)<br />
at module.exports ([eval]:397:8)<br />
at ScriptsManager.execute ([eval]:273021:34)<br />
at tryCatcher ([eval]:47244:23)<br />
at ret (eval at &lt;anonymous&gt; ([eval]:45923:1), &lt;anonymous&gt;:13:39)<br />
From previous event:<br />
at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] ([eval]:43056:19)<br />
at ret (eval at &lt;anonymous&gt; ([eval]:45923:1), &lt;anonymous&gt;:8:21)</p>
]]></description><link>https://forum.jsreport.net/post/2120</link><guid isPermaLink="true">https://forum.jsreport.net/post/2120</guid><dc:creator><![CDATA[Carl Blanchard]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How to handle Date&#x2F;Time values in JSRender on JSReports on Invalid Date]]></title><description><![CDATA[<p>i linked the jsviews helpers page just for you to see the jsrender syntax to call a helper. helpers for an engine are defined in a more generic way (a simple function) in jsreport.</p>
<p>here is link showing a basic example of this <a href="https://playground.jsreport.net/studio/workspace/H1hZ39rdz/4" rel="nofollow">https://playground.jsreport.net/studio/workspace/H1hZ39rdz/4</a>, you will need to update the <code>formatDate</code> logic to match your desired date format</p>
]]></description><link>https://forum.jsreport.net/post/2121</link><guid isPermaLink="true">https://forum.jsreport.net/post/2121</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How to handle Date&#x2F;Time values in JSRender on JSReports on Invalid Date]]></title><description><![CDATA[<p>Ahh the bottom window where you had your javascript what is that window? I need to combine the script with the HTML this is where the problem is for me.<br />
The combination of having the script in with the template. I've changed your example to show hows it's working. I need it working like this for our production service. which doesn't use the development studio.<br />
<a href="https://playground.jsreport.net/studio/workspace/H1hZ39rdz/5" rel="nofollow">https://playground.jsreport.net/studio/workspace/H1hZ39rdz/5</a></p>
]]></description><link>https://forum.jsreport.net/post/2135</link><guid isPermaLink="true">https://forum.jsreport.net/post/2135</guid><dc:creator><![CDATA[Carl Blanchard]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How to handle Date&#x2F;Time values in JSRender on JSReports on Invalid Date]]></title><description><![CDATA[<p>i think <a href="https://jsreport.net/learn/get-started#templating-engines" rel="nofollow">this section</a> describes what is that window. that window is a place where you can define helpers functions for your template engine.</p>
<blockquote>
<p>I need to combine the script with the HTML this is where the problem is for me.<br />
The combination of having the script in with the template. I've changed your example to show hows it's working. I need it working like this for our production service. which doesn't use the development studio.</p>
</blockquote>
<p>why do you need to have that function in the html in order to make it work on your production server? it does not matter if you don't use the studio in production, you can develop the template + helpers using the studio in your local machine and then you can deploy to production what you have on local, then your template will have everything it needs in production no matter if you don't use studio there.</p>
]]></description><link>https://forum.jsreport.net/post/2138</link><guid isPermaLink="true">https://forum.jsreport.net/post/2138</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>