About the Calendar
The Badíʿ calendar was introduced by the founders of the Bahá'í Faith, the Báb and Bahá'u'lláh, in the mid- to late-1800's (of the Gregorian calendar). More details can be found at this Wikipedia page: Badíʿ Calendar.
Installation
You can install this via nuget at NuGet: Badi Noda Time .
Usage
Using
Basic Dates
BadiNodaTime has complete support for translating dates between the Badíʿ calendar and the Gregorian calendar. Internally, Noda Time LocalDates with the `CalendarSystem.Badi` are used. If you use LocalDates, the full power of Noda Time is available to you. If you are not using Noda Time, you don't need to know anything about it!
Bahá'í Holy Days
This version of the library has full knowledge of the Bahá'í Holy Days and what days they fall on.
Date Formatting
The `ToString` method of each `BadiDate` object supports a non-standard extended formatting system. The `patternText` you supply is actually a template with a set of custom tokens that will be processed using that date.
A current list of the tokens supported can be obtained by reading `new BadiNodaTime.Utility.DateTemplateProcessor().AvailableTokens`. Here's a sample for 11 Questions 174:
- {day}
- 11
- {day00}
- 11
- {day_ordinal}
- eleventh
- {day_meaning}
- Will
- {day_arabic}
- Mashíyyat
- {weekday}
- 6
- {weekday00}
- 06
- {weekday_ordinal}
- sixth
- {weekday_meaning}
- Majesty
- {weekday_arabic}
- Istijlál
- {month}
- 15
- {month00}
- 15
- {month_ordinal}
- fifteenth
- {month_meaning}
- Questions
- {month_arabic}
- Masá'il
- {element}
- 4
- {element00}
- 04
- {element_meaning}
- Earth
- {yearOfEra}
- 174
- {yearOfEra00}
- 174
- {yearOfUnity}
- 3
- {yearOfUnity00}
- 03
- {yearOfUnity_ordinal}
- third
- {yearOfUnity_meaning}
- Father
- {yearOfUnity_arabic}
- Ab
- {unity}
- 10
- {unity00}
- 10
- {unity_ordinal}
- tenth
- {allThings}
- 1
- {allThings00}
- 01
- {allThings_ordinal}
- first
- {gregorian.day}
- 21
- {gregorian.day00}
- 21
- {gregorian.month}
- 12
- {gregorian.month00}
- 12
- {gregorian.month_latin_short}
- Dec
- {gregorian.month_latin_long}
- December
- {gregorian.year}
- 2017
The names used can be extended into your spoken language quite easily. Languages already in the package include: English, French, German, Dutch, Spanish, Portugese, Chinese, Esperanto, and Tamil. (Some are only partially translated.) For example, in German:
- {day_meaning}
- Wille
- {month_meaning}
- Fragen
Road Map
- Add time and sunset support. The current system ignores sunset and works as if the day starts at midnight.
- Improve .NET Core specific coding around dependency injection.
Feedback
Please contact Glen Little (glen.little@gmail.com) to discuss any improvements or additions that you might be interested in!