Developer forum

Forum » Templates » DateFormat: SetTag

DateFormat: SetTag

Anders Ebdrup
Reply

Hi Dw,

 

After upgrade to v8.2.3.0 I have some troubles with handling of the dateformat - the problem seems to be in this function:

public void SetTag(string name, DateTime value, string dateFormat)
    {
      if (this.Type == Template.TemplateType.Razor)
      {
        this.SetRawTag(name, (object) value);
      }
      else
      {
        if (!name.StartsWith("Global:") && !this.HtmlHasPartialTag(name))
          return;
        this.SetTag(name, value);
        string str = string.IsNullOrEmpty(dateFormat) ? Dates.ShowDate(value, dateFormat, false, "hh:mm") : value.ToShortDateString();
        this.SetTag(name, str);
        this.SetTag(name + ".ShortDate", str);
      }
    }

Where is tests for

string.IsNullOrEmpty(dateFormat)

And if it is empty, then try to format - I guess that the option part should be switched around.

 

Best regards, Anders


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Yes, that is a bug.

 

And now fixed... TFS#12254

Votes for this answer: 1

 

You must be logged in to post in the forum