AfricaCalendarData Class
Definition
- Namespace
- Bodu.Globalization.Calendar
- Assembly
- Bodu.Globalization.Calendar.Africa.dll
- Package
- Bodu.Globalization.Calendar.Africa 1.0.0
- Source
- AfricaCalendarData.cs
Provides access to the embedded Africa notable-date resource pack (South Africa, Nigeria, Kenya, Ghana, Ethiopia, Egypt, and Morocco), built on the notable-date schema.
public static class AfricaCalendarData
- Inheritance
-
AfricaCalendarData
- Inherited Members
Examples
// Query South African public holidays for a year.
NotableDateService service = AfricaCalendarData.CreateService("ZA");
DateRange year = new(new DateOnly(2026, 1, 1), new DateOnly(2026, 12, 31));
IReadOnlyList<NotableDate> holidays = service.Resolve(year, "ZA");
Remarks
Each supported country is a self-contained embedded resource. A territory may be a country code (ZA) or a
subdivision; the subdivision selects the same country resource, and the resolver filters by the full territory at
query time. The packs draw on the Western and Orthodox Christian, civil, and Islamic catalogues, and the
North-African packs declare a Friday/Saturday working week.
When to use. Call CreateService(string) for a ready-to-query NotableDateService, or LoadResource(string) when you need the underlying NotableDateResource to compose with custom collaborators or providers.
Properties
SupportedCountries
Gets the country codes the Africa pack provides resources for.
public static IReadOnlyList<string> SupportedCountries { get; }
Property Value
- IReadOnlyList<string>
The supported ISO 3166-1 alpha-2 country codes.
Methods
CreateService(string)
Builds a resolver over the resource for the country owning the supplied territory.
public static NotableDateService CreateService(string territory)
Parameters
territorystringA country code or subdivision (for example
ZA).
Returns
- NotableDateService
A service over the country's resource.
Exceptions
- ArgumentNullException
territoryis null.- ArgumentException
The territory's country is not provided by this pack.
LoadResource(string)
Loads the notable-date resource for the country owning the supplied territory.
public static NotableDateResource LoadResource(string territory)
Parameters
territorystringA country code or subdivision (for example
ZA).
Returns
- NotableDateResource
The loaded NotableDateResource.
Exceptions
- ArgumentNullException
territoryis null.- ArgumentException
The territory's country is not provided by this pack.
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |