[Mono-bugs] [Bug 362117] MonthCalendar's SelectionRange object constructor issues
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Feb 18 11:13:14 EST 2008
https://bugzilla.novell.com/show_bug.cgi?id=362117
User andyhume32 at yahoo.co.uk added comment
https://bugzilla.novell.com/show_bug.cgi?id=362117#c2
Andy Hume <andyhume32 at yahoo.co.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|MonthCalendar's SelectionRange object default |MonthCalendar's SelectionRange object
|constructor wrong end datetime |constructor issues
--- Comment #2 from Andy Hume <andyhume32 at yahoo.co.uk> 2008-02-18 09:13:13 MST ---
I found while investigating bug 362749, that an time component of the DateTimes
passed to the other constructor are stripped. Full set of unit-tests attached.
Changing title to cover both constructors, was: "MonthCalendar's SelectionRange
object default constructor wrong end datetime".
Patch is:
[[
Index: SelectionRange.cs
===================================================================
--- SelectionRange.cs (revision 96031)
+++ SelectionRange.cs (working copy)
@@ -40,6 +40,8 @@
// default parameterless construcor, use default values
public SelectionRange () {
+ end = DateTime.MaxValue.Date;
+ start = DateTime.MinValue.Date;
}
// constructor that receives another range, copies it's Start
and End values
@@ -51,11 +53,11 @@
// constructor that receives two dates, uses the lower of the
two as start
public SelectionRange (DateTime lower, DateTime upper) {
if (lower <= upper) {
- end = upper;
- start = lower;
+ end = upper.Date;
+ start = lower.Date;
} else {
- end = lower;
- start = upper;
+ end = lower.Date;
+ start = upper.Date;
}
}
]]
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list