diff --git a/PROMS/Volian.Controls.Library/DisplayHistory.cs b/PROMS/Volian.Controls.Library/DisplayHistory.cs index 9aa4fdd5..14ae9d78 100644 --- a/PROMS/Volian.Controls.Library/DisplayHistory.cs +++ b/PROMS/Volian.Controls.Library/DisplayHistory.cs @@ -531,6 +531,17 @@ namespace Volian.Controls.Library //Console.WriteLine("UpdateHistory: {0} seconds",TimeSpan.FromTicks(DateTime.Now.Ticks - start.Ticks).TotalSeconds); this.Cursor = Cursors.Default; } + // B2020-156: If time is at midnight, only check date. + private bool CompareDateOrDateTime(DateTime dt1, DateTime dt2) + { + if (dt1.TimeOfDay == TimeSpan.Zero || dt2.TimeOfDay == TimeSpan.Zero) + { + if (dt1.Date > dt2.Date) return true; + return false; + } + if (dt1 > dt2) return true; + return false; + } private void WalkProcedure() { //return; @@ -567,7 +578,10 @@ namespace Volian.Controls.Library _AnnotationList = aail2; foreach (ContentAuditInfo cai in cail2) { - if (cai.DTS > MyRevDate || cai.ActionWhen > MyRevDate) + // B2020-156: When procedure title is changed, it does not print in Summary/Chronolgy of changes. + // Need to only check the date (not the date/time) for some procedures, the original item was listed + // in the list box and should not be because some MyRevDate's did not have time included. + if (CompareDateOrDateTime(cai.DTS,MyRevDate) || cai.ActionWhen > MyRevDate) { string itemTitle = FixPath(cai.Path); lbChanges.Items.Add(cai);