You may consider looking at extending one of the custom calendars rather
than the abstract Calendar. You then don't need to override so many
methods. For example this class extends GregorianCalend ar, making years
relative to 1981.
class ModernCalendar : GregorianCalend ar
{
public override int GetYear(DateTim e time)
{
return time.Year - 1981;
}
}
Then you could call it via:
static void Main(string[] args)
{
ModernCalendar mc = new ModernCalendar( );
GregorianCalend ar gc = new GregorianCalend ar();
DateTime gcday = new DateTime(2008, 11, 19, gc);
Console.Out.Wri teLine(gcday);
DateTime modday = new DateTime(
mc.GetYear(gcda y), mc.GetMonth(gcd ay), mc.GetDayOfMont h(gcday), mc);
Console.Out.Wri teLine(modday.T oString());
Console.Out.Wri teLine("OK");
Console.In.Read Line();
}
"Arthur Parker" <Ar**********@d iscussions.micr osoft.comwrote in message
news:9A******** *************** ***********@mic rosoft.com...
>I have been looking for information on creating new custom calendars; not
the
control, but the class that manages dates and date calculations. The only
thing I've been able to find in any of the MS documentation or newsgroups
is
that you _can_ derive custom calendars from
System.Globabli zation.Calendar ,
but not a word on what you would need to do to accomplish that. Has
anyone
ever done or seen any custom calendar implementations ? I'd appreciate any
help or pointers on this.