Posted on 27/06/2014 11:14:29
I have a simular issue. Trying to format a date on an item:
<!--@ItemPublisher:Item.Publish_Date.Format({0:MM/dd/yy H:mm:ss zzz})-->
11/22/2000 returns: 11/22/2000
I am on 8.4.1.15.
If I wrap the format param in quotes I get this .NET error, perhaps it help you debugging:
System.FormatException: Input string was not in a correct format.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at System.String.Format(String format, Object arg0)
at Dynamicweb.Rendering.Template.ProcessMethods(String tagName, String value, String methods)
at Dynamicweb.Rendering.Template.GetTagValue(Match match)
at Dynamicweb.Rendering.Template.ReplaceTag(Match match)
at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator, Int32 count, Int32 startat)
at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
at Dynamicweb.Rendering.Template.ReplaceTags(String tmpOutput)
at Dynamicweb.Rendering.Template.Output()
at Dynamicweb.Rendering.Loop.Commit(String parentName, Int32 parentLoopIndex, Int32 loopCounter)
at Dynamicweb.Rendering.Template.CommitLoop()
at Dynamicweb.Content.Items.Rendering.Renderer.RenderItems(IEnumerable`1 items, ItemListSettings settings)
at Dynamicweb.Modules.ItemPublisher.Frontend.List()
at Dynamicweb.Modules.ItemPublisher.Frontend.GetContent()
at Dynamicweb.Frontend.Content.getModule(DataRow& ParagraphRow)
Med venlig hilsen/Best regards,
Sten Hougaard
Webudvikler
E: sho@1stweb.dk
M: 29850818
A: København/Aarhus . W: www.1stweb.dk
@: netsi1964