473,606 Members | 2,101 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.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.
Oct 22 '08 #1
1 2402
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.
Oct 23 '08 #2

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

Similar topics

10
1486
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 (so would have to be simple programming wise). Trying to find a free source that will be easier then hard coding a table to do the job. Any ideas? thanks,
6
4476
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. Thanks
1
2784
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 have tried the Active X calendar but this only allows you to select the date. Thaks in advance Dawn Davis
0
1084
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 array to mark the days that I have in the database for each calendar. Basically a year view of what dates are blocked and what days are free. Booking calendar. The problem is that when the page posts back, the first 11, Jan-Nov, calendars work. ...
1
2047
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, assigning them to an array and then in the DayRender Event, itterating through the array to mark the days that I have in the database for each calendar. Basically a year view of what dates are blocked and what days are free. Booking calendar. The...
1
2045
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 accessibility and convenience. When it comes to creating web sites, the PHP scripting language is truly a red-hot property. In fact, PHP is currently used on more than 19 million web sites, surpassing
1
1398
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 away from other users who could look at their calendars across the network. However I am now looking to improve on the calendar so that it actually updates the users outlook calendar, when they add a new event into the Intranet calendar.
1
1460
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 following months are selected in the other two, so that you always get three correlative months in the calendars. Is that possible somehow? Also, I need to add a new row at the end of the calendar with an "OK" button to close the calendar, how can I...
1
2174
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 controls. Only problem is that I'm used to designing my controls in a WYSIWYG (tm) way (i.e. using the designer and writing HTML tags). The only way I found to create custom controls was to create controls dynamically, set their properties and...
0
7942
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8433
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8429
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8300
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6761
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5461
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3922
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1550
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.