コード例 #1
0
        public static void JulianDayToLocal(SPCalendarType calType, int jDay, IntlDate id)
        {
            SimpleDate simpleDate = new SimpleDate(0, 0, 0);

            SPIntlCal.GetLocalCalendar(calType).JulianDayToDate(jDay, ref simpleDate, 0, 0);
            id.Init(simpleDate.Year, simpleDate.Month, simpleDate.Day, simpleDate.Era, calType);
        }
コード例 #2
0
 public static bool IsCalendarSupported(SPCalendarType calType)
 {
     try
     {
         SPIntlCal.GetLocalCalendar(calType);
         return(true);
     }
     catch (Exception)
     {
     }
     return(false);
 }
コード例 #3
0
        public static int GetWeekNumber(SPCalendarType calType, SimpleDate di, int FirstDayOfWeek, short FirstWeekOfYear)
        {
            int num  = di.Day;
            int num2 = di.Month;

            while (--num2 > 0)
            {
                SimpleDate simpleDate = new SimpleDate(di.Year, num2, 1);
                num += SPIntlCal.DaysInLocalMonth(calType, ref simpleDate);
            }
            SimpleDate simpleDate2 = new SimpleDate(di.Year, 1, 1, di.Era);
            int        num3        = SPIntlCal.LocalToJulianDay(calType, ref simpleDate2);
            int        num4        = (num3 + 1) % 7;
            int        num5        = (num - 1) / 7 + 1;

            if (num4 < FirstDayOfWeek)
            {
                num4 += 7;
            }
            if (FirstDayOfWeek < 7 && FirstDayOfWeek >= 0)
            {
                if (FirstWeekOfYear == 2 && num4 > FirstDayOfWeek + 3)
                {
                    goto IL_0097;
                }
                if (FirstWeekOfYear == 1 && num4 != FirstDayOfWeek)
                {
                    goto IL_0097;
                }
            }
            goto IL_009b;
IL_009b:
            return(num5);

IL_0097:
            num5--;
            goto IL_009b;
        }
コード例 #4
0
 public static bool IsSupportedLocalJulianDay(SPCalendarType calType, int jDay)
 {
     return(SPIntlCal.GetLocalCalendar(calType).IsSupportedJulianDay(jDay));
 }
コード例 #5
0
 public static bool IsLocalDateValid(SPCalendarType calType, ref SimpleDate di, int iAdvance, int jDayCurrent)
 {
     return(SPIntlCal.GetLocalCalendar(calType).IsDateValid(ref di, iAdvance, jDayCurrent));
 }
コード例 #6
0
 public static bool IsLocalDateValid(SPCalendarType calType, ref SimpleDate di)
 {
     return(SPIntlCal.GetLocalCalendar(calType).IsDateValid(ref di, 0, 0));
 }
コード例 #7
0
 public static bool IsSupportedLocalDate(SPCalendarType calType, ref SimpleDate di)
 {
     return(SPIntlCal.GetLocalCalendar(calType).IsSupportedDate(ref di));
 }
コード例 #8
0
 public static bool IsSupportedLocalMonth(SPCalendarType calType, int year, int month)
 {
     return(SPIntlCal.GetLocalCalendar(calType).IsSupportedMonth(year, month));
 }
コード例 #9
0
        public static int LocalToJulianDay(SPCalendarType calType, IntlDate id)
        {
            SimpleDate simpleDate = new SimpleDate(id.Year, id.Month, id.Day, id.Era);

            return(SPIntlCal.GetLocalCalendar(calType).DateToJulianDay(ref simpleDate, 0, 0));
        }
コード例 #10
0
 public static int DaysInLocalMonth(SPCalendarType calType, ref SimpleDate di, int iAdvance)
 {
     return(SPIntlCal.GetLocalCalendar(calType).DaysInMonth(ref di, iAdvance));
 }
コード例 #11
0
 public static int MonthsInLocalYear(SPCalendarType calType, ref SimpleDate di)
 {
     return(SPIntlCal.GetLocalCalendar(calType).MonthsInYear(ref di));
 }
コード例 #12
0
 public static bool IsLocalYearLeap(SPCalendarType calType, int year)
 {
     return(SPIntlCal.GetLocalCalendar(calType).IsYearLeap(year));
 }
コード例 #13
0
 public static int GetEraJulianDay(SPCalendarType calType, int era)
 {
     return(SPIntlCal.GetLocalCalendar(calType).GetEraJulianDay(era));
 }
コード例 #14
0
 public static int EraOffset(SPCalendarType calType, int era)
 {
     return(SPIntlCal.GetLocalCalendar(calType).GetEraOffset(era));
 }
コード例 #15
0
 public static int LocalToJulianDay(SPCalendarType calType, ref SimpleDate di)
 {
     return(SPIntlCal.GetLocalCalendar(calType).DateToJulianDay(ref di, 0, 0));
 }
コード例 #16
0
 public static int LocalToJulianDay(SPCalendarType calType, ref SimpleDate di, int iAdvance, int jDayCurrent)
 {
     return(SPIntlCal.GetLocalCalendar(calType).DateToJulianDay(ref di, iAdvance, jDayCurrent));
 }
コード例 #17
0
 public static bool IsSupportedLocalYear(SPCalendarType calType, int year)
 {
     return(SPIntlCal.GetLocalCalendar(calType).IsSupportedYear(year));
 }
コード例 #18
0
 public static void JulianDayToLocal(SPCalendarType calType, int jDay, ref SimpleDate di)
 {
     SPIntlCal.GetLocalCalendar(calType).JulianDayToDate(jDay, ref di, 0, 0);
 }
コード例 #19
0
 public static void JulianDayToLocal(SPCalendarType calType, int jDay, ref SimpleDate di, int iAdvance, int jDayCurrent)
 {
     SPIntlCal.GetLocalCalendar(calType).JulianDayToDate(jDay, ref di, iAdvance, jDayCurrent);
 }