I try to calculate the ramadan feast. I use the HijriCalendar for this issue. I have check wikipedia and ramadan feast is on the end of the islamic month Ramadan.
Some dates are good but other on the wrong day (1 day deferred)
var hijriCalendar = new HijriCalendar();
for (var i = 1431; i <= 1438; i++)
{
var dateTime = new DateTime(i, 10, 1, hijriCalendar);
Console.WriteLine(dateTime.ToString("yyyy-MM-dd"));
}
Public Holiday Ramadan Feast First value calculated, second the correct value
- 2010-09-09 (2010-09-09)
- 2011-08-30 (2011-08-30)
- 2012-08-18 (2012-08-19) WRONG +1
- 2013-08-07 (2013-08-08) WRONG +1
- 2014-07-28 (2014-07-28)
- 2015-07-17 (2015-07-17)
- 2016-07-06 (2016-07-05) WRONG -1
- 2017-06-25 (2017-07-25)
Source of correct date https://www.timeanddate.com/holidays/turkey/ramadan-feast