Craig's Utility Library  4.0 Beta
Utilities.DataTypes.DateSpan Class Reference

Represents a date span More...

Public Member Functions

 DateSpan (DateTime start, DateTime end)
 Constructor More...
 
override bool Equals (object obj)
 Determines if two objects are equal More...
 
override int GetHashCode ()
 Gets the hash code for the date span More...
 
DateSpan Intersection (DateSpan Span)
 Returns the intersecting time span between the two values More...
 
bool Overlap (DateSpan Span)
 Determines if two DateSpans overlap More...
 
override string ToString ()
 Converts the DateSpan to a string More...
 

Static Public Member Functions

static bool operator!= (DateSpan Span1, DateSpan Span2)
 Determines if two DateSpans are not equal More...
 
static DateSpan operator+ (DateSpan Span1, DateSpan Span2)
 Addition operator More...
 
static bool operator== (DateSpan Span1, DateSpan Span2)
 Determines if two DateSpans are equal More...
 
static implicit operator string (DateSpan Value)
 Converts the object to a string More...
 

Properties

virtual int Days [get]
 Days between the two dates More...
 
virtual DateTime End [get, protected set]
 End date More...
 
virtual int Hours [get]
 Hours between the two dates More...
 
virtual int MilliSeconds [get]
 Milliseconds between the two dates More...
 
virtual int Minutes [get]
 Minutes between the two dates More...
 
virtual int Months [get]
 Months between the two dates More...
 
virtual int Seconds [get]
 Seconds between the two dates More...
 
virtual DateTime Start [get, protected set]
 Start date More...
 
virtual int Years [get]
 Years between the two dates More...
 

Detailed Description

Represents a date span

Definition at line 30 of file DateSpan.cs.

Constructor & Destructor Documentation

Utilities.DataTypes.DateSpan.DateSpan ( DateTime  start,
DateTime  end 
)

Constructor

Parameters
startStart of the date span
endEnd of the date span

Definition at line 37 of file DateSpan.cs.

Member Function Documentation

override bool Utilities.DataTypes.DateSpan.Equals ( object  obj)

Determines if two objects are equal

Parameters
objObject to check
Returns
True if they are, false otherwise

Definition at line 150 of file DateSpan.cs.

override int Utilities.DataTypes.DateSpan.GetHashCode ( )

Gets the hash code for the date span

Returns
The hash code

Definition at line 160 of file DateSpan.cs.

DateSpan Utilities.DataTypes.DateSpan.Intersection ( DateSpan  Span)

Returns the intersecting time span between the two values

Parameters
SpanSpan to use
Returns
The intersection of the two time spans

Definition at line 170 of file DateSpan.cs.

static implicit Utilities.DataTypes.DateSpan.operator string ( DateSpan  Value)
static

Converts the object to a string

Parameters
ValueValue to convert
Returns
The value as a string

Definition at line 139 of file DateSpan.cs.

static bool Utilities.DataTypes.DateSpan.operator!= ( DateSpan  Span1,
DateSpan  Span2 
)
static

Determines if two DateSpans are not equal

Parameters
Span1Span 1
Span2Span 2
Returns
True if they are not equal, false otherwise

Definition at line 95 of file DateSpan.cs.

static DateSpan Utilities.DataTypes.DateSpan.operator+ ( DateSpan  Span1,
DateSpan  Span2 
)
static

Addition operator

Parameters
Span1Span 1
Span2Span 2
Returns
The combined date span

Definition at line 106 of file DateSpan.cs.

static bool Utilities.DataTypes.DateSpan.operator== ( DateSpan  Span1,
DateSpan  Span2 
)
static

Determines if two DateSpans are equal

Parameters
Span1Span 1
Span2Span 2
Returns
True if they are, false otherwise

Definition at line 125 of file DateSpan.cs.

bool Utilities.DataTypes.DateSpan.Overlap ( DateSpan  Span)

Determines if two DateSpans overlap

Parameters
SpanThe span to compare to
Returns
True if they overlap, false otherwise

Definition at line 186 of file DateSpan.cs.

override string Utilities.DataTypes.DateSpan.ToString ( )

Converts the DateSpan to a string

Returns
The DateSpan as a string

Definition at line 196 of file DateSpan.cs.

Property Documentation

virtual int Utilities.DataTypes.DateSpan.Days
get

Days between the two dates

Definition at line 47 of file DateSpan.cs.

virtual DateTime Utilities.DataTypes.DateSpan.End
getprotected set

End date

Definition at line 52 of file DateSpan.cs.

virtual int Utilities.DataTypes.DateSpan.Hours
get

Hours between the two dates

Definition at line 57 of file DateSpan.cs.

virtual int Utilities.DataTypes.DateSpan.MilliSeconds
get

Milliseconds between the two dates

Definition at line 62 of file DateSpan.cs.

virtual int Utilities.DataTypes.DateSpan.Minutes
get

Minutes between the two dates

Definition at line 67 of file DateSpan.cs.

virtual int Utilities.DataTypes.DateSpan.Months
get

Months between the two dates

Definition at line 72 of file DateSpan.cs.

virtual int Utilities.DataTypes.DateSpan.Seconds
get

Seconds between the two dates

Definition at line 77 of file DateSpan.cs.

virtual DateTime Utilities.DataTypes.DateSpan.Start
getprotected set

Start date

Definition at line 82 of file DateSpan.cs.

virtual int Utilities.DataTypes.DateSpan.Years
get

Years between the two dates

Definition at line 87 of file DateSpan.cs.


The documentation for this class was generated from the following file: