im trying to create a sitemap via velocity template in dotcms
this is my code
#set($articles = $json.fetch('https://xxxxx.xxxx.xxx/api/content/render/false/type/json/query/+contentType:YmArticlePage%20+(conhost:b5d82078-a844-4104-9664-4348c2420bba%20conhost:SYSTEM_HOST)%20+(wfscheme:d61a59e1-a49c-46f2-a929-db2b4bfa88b2*)%20+(wfstep:dc3c9cd0-8467-404b-bf95-cb7df3fbc293*)%20/limit/1/orderby/score,modDate%20desc'))
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
#foreach($article in $articles.contentlets)
<url>
<loc>$!{host}$!{article.path}</loc>
<changefreq>always</changefreq>
<priority>0.6</priority>
<lastmod>$date.format('medium', $article.modDate) $article.modDate</lastmod>
</url>
#end
</urlset>
i am able to render the $article.modDate, but if i am to format it using dateViewtool it doesnt seem to format it and just display the string "$date.format('medium', $article.modDate)" when viewed in the browser.
see screenshot below.