473,385 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creating new custom calendars

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.Globablization.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.
Oct 22 '08 #1
1 2384
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 GregorianCalendar, making years
relative to 1981.

class ModernCalendar : GregorianCalendar
{
public override int GetYear(DateTime time)
{
return time.Year - 1981;
}
}

Then you could call it via:

static void Main(string[] args)
{
ModernCalendar mc = new ModernCalendar();
GregorianCalendar gc = new GregorianCalendar();

DateTime gcday = new DateTime(2008, 11, 19, gc);
Console.Out.WriteLine(gcday);
DateTime modday = new DateTime(
mc.GetYear(gcday), mc.GetMonth(gcday), mc.GetDayOfMonth(gcday), mc);
Console.Out.WriteLine(modday.ToString());

Console.Out.WriteLine("OK");
Console.In.ReadLine();
}

"Arthur Parker" <Ar**********@discussions.microsoft.comwrote in message
news:9A**********************************@microsof t.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.Globablization.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.
Oct 23 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: gregory stevenson | last post by:
I am looking for a calendar program or script to set up calendars for my low income business based site. I want to put regular events and such. I want to make it available to most web audiences...
6
by: di | last post by:
Does anyone have any recommendations on Examples or experience on creating a multilevel commission in Access Database. I realize this can be a very complicated set up so would like some advise....
1
by: Andy Davis | last post by:
I want to be able to create a calendar where the user can type text on a paricular day of the month on the calendar (similar to MS Outlook calendar). Is there any way this can be done in Access. I...
0
by: Mariano Padilla | last post by:
I have a form that has 12 Calendar, 1 for each month. I am retrieving information from a database separately, assigning them to an array and then in the DayRender Event, itterating through the...
1
by: Mariano Padilla | last post by:
I poste the below on 11-28-05 and got no answer. Could anyone please help me? I have a form that has 12 Calendar, 1 for each month. I am retrieving information from a database separately,...
1
by: code | last post by:
Hi Grp http://www.books-download.com/?Book=1493-PHP+Hacks+%3a+Tips+%26+Tools+For+Creating+Dynamic+Websites+(Hacks) Description Programmers love its flexibility and speed; designers love its...
1
by: si_owen | last post by:
Hi Folks, I have not too long ago built a customised calendar for my company's intranet. This was just a little calendar that users could add private events and reminders so that they were kept...
1
by: federicog | last post by:
I'm using this calendar: http://www.dynarch.com/projects/calendar/. I have three calendars on a page, and I need to "link" them together so that if I select a month in one calendar, the two...
1
by: Abdo Haji-Ali | last post by:
Previously I used to create user controls if I wanted to use a specific set of controls in multiple pages, however I want to deploy my control in other applications so I thought of creating custom...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.