Esempio n. 1
0
        public void TestZeroDOM()
        {
            ChineseCalendar cal = new ChineseCalendar();

            IBM.ICU.Util.GregorianCalendar greg = new IBM.ICU.Util.GregorianCalendar(1989,
                                                                                     IBM.ICU.Util.Calendar.SEPTEMBER, 1);
            Logln("Start: " + greg.GetTime());
            for (int i = 0; i < 1000; ++i)
            {
                cal.SetTimeInMillis(greg.GetTimeInMillis());
                if (cal.Get(IBM.ICU.Util.Calendar.DAY_OF_MONTH) == 0)
                {
                    Errln("Fail: "
                          + greg.GetTime()
                          + " -> "
                          + cal.Get(IBM.ICU.Util.Calendar.EXTENDED_YEAR)
                          + "/"
                          + cal.Get(IBM.ICU.Util.Calendar.MONTH)
                          + ((cal.Get(IBM.ICU.Util.ChineseCalendar.IS_LEAP_MONTH) == 1) ? "(leap)"
                                    : "") + "/" + cal.Get(IBM.ICU.Util.Calendar.DAY_OF_MONTH));
                }
                greg.Add(IBM.ICU.Util.Calendar.DAY_OF_YEAR, 1);
            }
            Logln("End: " + greg.GetTime());
        }