C#: Calculating all Greek Public Holidays for any given year

After calculating the Greek Orthodox Easter, I wrote the following method that returns a List of DateTime with all the public holidays in Greece:

        /// <summary>
        /// Get all Greek holidays for requested year
        /// </summary>
        /// <param name="year">Year of holidays</param>
        /// <returns>List of dates of all official holidays, except weekends</returns>
        public static List<DateTime> GreekHolidays( int year ) {
            List<DateTime> All = new List<DateTime>();

            DateTime dt = common.Libraries.Calendar.GetOrthodoxEaster( year );

            All.Add( new DateTime( year, 1, 1 ) );//prwtoxronia
            All.Add( new DateTime( year, 1, 6 ) );//fwta
            All.Add( dt.AddDays( -48 ) );//kathara deytera
            All.Add( new DateTime( year, 3, 25 ) );//25i martioy
            All.Add( new DateTime( year, 5, 1 ) );//prwtomagia
            All.Add( dt.AddDays( -2 ) );//megali paraskevi
            All.Add( dt.AddDays( -1 ) );//megali savvato
            All.Add( dt );//pasxa
            All.Add( dt.AddDays( 1 ) );//deyterh mera
            All.Add( dt.AddDays( 50 ) );//agiou pnevmatos
            All.Add( new DateTime( year, 8, 15 ) );//koimisi theotokou
            All.Add( new DateTime( year, 10, 28 ) );//28i
            All.Add( new DateTime( year, 12, 25 ) );//xristougenna
            All.Add( new DateTime( year, 12, 26 ) );//deyterh mera

            return All;
        }

You can find the code that calculates Greek Orthodox Easter here: https://mycodepad.wordpress.com/2013/04/25/c-calculating-orthodox-and-catholic-easter/

Advertisements

One thought on “C#: Calculating all Greek Public Holidays for any given year

  1. Pingback: C#: Calculating Orthodox and Catholic Easter | My CodePad

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s