Determines whether specified object represents a Monday day of week. - CSharp System

CSharp examples for System:DateTime Day

Description

Determines whether specified object represents a Monday day of week.

Demo Code


using System.Globalization;
using System;//  w  w  w .  j a  v a2  s.co m

public class Main{
        /// <summary>
    ///   <para>Determines whether specified <see cref="DateTime"/> object represents a Monday day of week.</para>
    /// </summary>
    /// <param name="self">Date instance.</param>
    /// <returns><c>true</c> of <paramref name="self"/>'s day of week is Monday, false if not.</returns>
    /// <seealso cref="DateTime.DayOfWeek"/>
    public static bool Monday(this DateTime self)
    {
      return self.DayOfWeek == DayOfWeek.Monday;
    }
}

Related Tutorials