Tuesday, June 21, 2011

Computing Broadcast Calendar Dates in Ruby

While building a new product I discovered that broadcast advertisers use a special broadcast calendar to normalize advertising schedules. Each month starts on a Monday. I made an tiny open source Ruby gem called broadcast_calendar to compute the Gregorian/civil dates for broadcast months:

gem install broadcast_calendar

> BroadcastCalendar.dates_for(5,2011)
=> Mon, 25 Apr 2011..Sun, 29 May 2011

I also found a list of pre-printed broadcast calendar dates.

2 comments:

Unknown said...

Hello,
Can you help me the broadcast calendar logic? I am working on similar project using C#.
Your assistance will be greatly appreciated.

John, C# & SharePoint Developer at www.ithq.us

Anonymous said...

Hi Koko

Visit http://www.codeproject.com/Articles/168662/Time-Period-Library-for-NET for a c# implementation.

Cheers, Jani