This documentation is archived and is not being maintained.

HijriCalendar.IsLeapMonth Method

Determines whether the specified month is a leap month.

Overload List

Determines whether the specified month in the specified year in the specified era is a leap month.

[Visual Basic] Overloads Overrides Public Function IsLeapMonth(Integer, Integer, Integer) As Boolean
[C#] public override bool IsLeapMonth(int, int, int);
[C++] public: bool IsLeapMonth(int, int, int);
[JScript] public override function IsLeapMonth(int, int, int) : Boolean;

Inherited from Calendar.

[Visual Basic] Overloads Public Overridable Function IsLeapMonth(Integer, Integer) As Boolean
[C#] public virtual bool IsLeapMonth(int, int);
[C++] public: virtual bool IsLeapMonth(int, int);
[JScript] public function IsLeapMonth(int, int) : Boolean;

Example

[Visual Basic, C#, C++] The following code example calls IsLeapMonth for all the months in five years in the current era.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of IsLeapMonth. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Imports System
Imports System.Globalization
Imports Microsoft.VisualBasic

Public Class SamplesHijriCalendar   
   
   Public Shared Sub Main()

      ' Creates and initializes a HijriCalendar.
      Dim myCal As New HijriCalendar()

      ' Checks all the months in five years in the current era.
      Dim iMonthsInYear As Integer
      Dim y As Integer
      For y = 1421 To 1425
         Console.Write("{0}:" + ControlChars.Tab, y)
         iMonthsInYear = myCal.GetMonthsInYear(y, HijriCalendar.CurrentEra)
         Dim m As Integer
         For m = 1 To iMonthsInYear
            Console.Write(ControlChars.Tab + "{0}", myCal.IsLeapMonth(y, m, HijriCalendar.CurrentEra))
         Next m
         Console.WriteLine()
      Next y

   End Sub 'Main 

End Class 'SamplesHijriCalendar


'This code produces the following output.

'

'1421:           False   False   False   False   False   False   False   False   False   False   False   False

'1422:           False   False   False   False   False   False   False   False   False   False   False   False

'1423:           False   False   False   False   False   False   False   False   False   False   False   False

'1424:           False   False   False   False   False   False   False   False   False   False   False   False

'1425:           False   False   False   False   False   False   False   False   False   False   False   False



[C#] 
using System;
using System.Globalization;


public class SamplesHijriCalendar  {

   public static void Main()  {

      // Creates and initializes a HijriCalendar.
      HijriCalendar myCal = new HijriCalendar();

      // Checks all the months in five years in the current era.
      int iMonthsInYear;
      for ( int y = 1421; y <= 1425; y++ )  {
         Console.Write( "{0}:\t", y );
         iMonthsInYear = myCal.GetMonthsInYear( y, HijriCalendar.CurrentEra );
         for ( int m = 1; m <= iMonthsInYear; m++ )
            Console.Write( "\t{0}", myCal.IsLeapMonth( y, m, HijriCalendar.CurrentEra ) );
         Console.WriteLine();
      }

   }

}

/*
This code produces the following output.

1421:           False   False   False   False   False   False   False   False   False   False   False   False
1422:           False   False   False   False   False   False   False   False   False   False   False   False
1423:           False   False   False   False   False   False   False   False   False   False   False   False
1424:           False   False   False   False   False   False   False   False   False   False   False   False
1425:           False   False   False   False   False   False   False   False   False   False   False   False

*/

[C++] 
#using <mscorlib.dll>
using namespace System;
using namespace System::Globalization;

int main()
{
   // Creates and initializes a HijriCalendar.
   HijriCalendar* myCal = new HijriCalendar();

   // Checks all the months in five years in the current era.
   int iMonthsInYear;
   for (int y = 1421; y <= 1425; y++) 
   {
      Console::Write(S" {0}:\t", __box(y));
      iMonthsInYear = myCal -> GetMonthsInYear(y, HijriCalendar::CurrentEra);
      for (int m = 1; m <= iMonthsInYear; m++)
         Console::Write(S"\t {0}", __box(myCal -> IsLeapMonth(y, m, HijriCalendar::CurrentEra)));
      Console::WriteLine();
   }
}

/*
This code produces the following output.

1421:           False   False   False   False   False   False   False   False   False   False   False   False
1422:           False   False   False   False   False   False   False   False   False   False   False   False
1423:           False   False   False   False   False   False   False   False   False   False   False   False
1424:           False   False   False   False   False   False   False   False   False   False   False   False
1425:           False   False   False   False   False   False   False   False   False   False   False   False

*/

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

HijriCalendar Class | HijriCalendar Members | System.Globalization Namespace

Show: