Example #1
0
        public void TestEraStart()
        {
            EthiopicCalendar cal = new EthiopicCalendar(0, 0, 1);
            SimpleDateFormat fmt = new SimpleDateFormat("EEE MMM dd, yyyy GG");

            AssertEquals("Ethiopic Date", "Tue Jan 01, 0000 AD", fmt.FormatObject(cal));

            // The gregorian calendar gets off by two days when
            // the date gets low, unless the gregorian changeover is set to
            // very early. The funny thing is, it's ok for dates in the year
            // 283, but not in the year 7, and it claims to be ok until the year 4.
            // should track down when the dates start to differ...

            IBM.ICU.Util.GregorianCalendar gc = new IBM.ICU.Util.GregorianCalendar();
            gc.SetGregorianChange(ILOG.J2CsMapping.Util.DateUtil.DateFromJavaMillis((Int64.MinValue))); // act like proleptic
            // Gregorian
            gc.SetTime(cal.GetTime());
            AssertEquals("Gregorian Date", "Tue Aug 28, 0007 AD", fmt.FormatObject(gc));
        }