migueldeicaza / MonoTouch.Dialog

Tools to simplify creating dialogs with the user using MonoTouch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MessageElement failure on Date property

henrikweimenhog opened this issue · comments

There is a simple bug in the rendering of the date on the Mesaage Element. There is an if statement which checks if it is the same date and if so it just renders the time.
Problem is that the check is not on the date but rather the day of the month. So if you have elements from more than 1 month you will get time renderings if the day is the same.

Quick fix is to change
if (DateTime.Now.Day == Date.Day)
label = Date.ToShortTimeString ();

into
if (DateTime.Now.ToShortDateString() == Date.Date.ToShortDateString())
label = Date.ToShortTimeString ();

Thanks in advance

Thanks! Fixed