
+++ Kemps-Benedix Torsten [Jul 13 09 23:56 ]:
Hello,
is there a working example of how to use the format clause with HStringTemplate, e.g. for Data.Time.Day? I think, if there is a parameter $day$, a reasonable template might contain e.g.:
$day;format="%d.%b.%Y"$
But I only get "toModifiedJulianDay: [54960]" as the result which corresponds to the unformatted show.
You probably need to define a StringTemplateShows instance for Data.Time.Day, and then use stShowsToSE to define a ToSElem instance. Something like instance StringTemplateShows Day where stringTemplateFormattedShow formatString = formatTime defaultTimeLocale formatString {- or whatever -- I'm not sure what the correct time-formatting function is -} instance ToSElem Day where toSElem = stShowsToSE John