Inheritance: IImmutableDate, IComparable
Ejemplo n.º 1
0
 /// <summary>
 /// Returns the result of comparing this instance to another <b>DateValue</b>.
 /// </summary>
 /// <param name="other">The <b>DateValue</b> instance to compare with.</param>
 /// <returns>An integer value indicating the relative ordering.</returns>
 public int CompareTo(DateValue other)
 {
     return (date - other.date);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Determines if this <b>DateValue</b> instance and another instance hold
 /// the same date.
 /// </summary>
 /// <param name="other">The <b>DateValue</b> instance to compare with.</param>
 /// <returns><b>true</b> if both instances represent the same date,
 /// <b>false</b> otherwise.</returns>
 public bool Equals(DateValue other)
 {
     return (date == other.date);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a <b>DateTime</b> instance from its date, time and
 /// time zone components.
 /// </summary>
 /// <param name="dateValue">The <see cref="DateValue"/> component.</param>
 /// <param name="timeValue">The <see cref="TimeValue"/> component.</param>
 /// <param name="timeZone">The <see cref="TimeZone"/> component or <b>null</b>.</param>
 internal DateTime(DateValue dateValue, TimeValue timeValue, TimeZone timeZone)
     : base(timeZone)
 {
     this.dateValue = dateValue;
     this.timeValue = timeValue;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a <b>DateTime</b> instance from its date, time and
 /// time zone components.
 /// </summary>
 /// <param name="dateValue">The <see cref="DateValue"/> component.</param>
 /// <param name="timeValue">The <see cref="TimeValue"/> component.</param>
 /// <param name="timeZone">The <see cref="TimeZone"/> component or <b>null</b>.</param>
 internal DateTime(DateValue dateValue, TimeValue timeValue, TimeZone timeZone)
     : base(timeZone)
 {
     this.dateValue = dateValue;
     this.timeValue = timeValue;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Returns the number of days in the given month for the specified
 /// year.
 /// </summary>
 /// <param name="month">The month number (1-12).</param>
 /// <param name="year">The year (1900-2099).</param>
 /// <returns>The length of the given month in the specified year.</returns>
 public static int MonthLength(int month, int year)
 {
     return(DateValue.MonthLength(month, year));
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Returns the number of days in the given month in a leap or non-leap
 /// year.
 /// </summary>
 /// <param name="month">The month number (1-12).</param>
 /// <param name="leapYear">Flag to indicate a leap year.</param>
 /// <returns>The length of the given month in the indicated type of
 /// year.</returns>
 public static int MonthLength(int month, bool leapYear)
 {
     return(DateValue.MonthLength(month, leapYear));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Determines if a year is a leap year.
 /// </summary>
 /// <param name="year">The year to test (1900-2099)</param>
 /// <returns><c>true</c> if the year is a leap year, <c>false</c>
 /// otherwise.</returns>
 public static bool IsLeapYear(int year)
 {
     return(DateValue.IsLeapYear(year));
 }