EthiopianCalendarConverter 1.2.1

dotnet add package EthiopianCalendarConverter --version 1.2.1
NuGet\Install-Package EthiopianCalendarConverter -Version 1.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EthiopianCalendarConverter" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EthiopianCalendarConverter --version 1.2.1
#r "nuget: EthiopianCalendarConverter, 1.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EthiopianCalendarConverter as a Cake Addin
#addin nuget:?package=EthiopianCalendarConverter&version=1.2.1

// Install EthiopianCalendarConverter as a Cake Tool
#tool nuget:?package=EthiopianCalendarConverter&version=1.2.1

Ethiopian Calendar Converter

Overview

Ethiopian Calendar Converter is a .NET library that provides methods to convert and manipulate dates in the Ethiopian and Gregorian calendars. It allows you to easily convert dates from GC to EC and perform various date-related calculations.

Installation

You can install the Ethiopian Calendar Converter library via NuGet. To install the package, run the following command in the Package Manager Console:

PM> Install-Package EthiopianCalendarConverter

Usage

Initializing Ethiopian Calendar

To start using the Ethiopian Calendar Converter, you need to create an instance of the EthiopianCalendar class by providing a date in the Gregorian calendar.

using EthiopianCalendarConverter;

// ...

DateTime gregorianDate = new DateTime(2023, 1, 1);
EthiopianCalendar ethiopianCalendar = new EthiopianCalendar(gregorianDate);

Converting Dates

The EthiopianCalendar class provides methods to convert dates between the Gregorian and Ethiopian calendars and to display different properties of the date.

Gregorian to Ethiopian

DateTime gregorianDate = new DateTime(2023, 1, 1);
string ethiopianDate = ethiopianCalendar.Date(); // Output: "2015-04-23"

"

Date Information

The EthiopianCalendar class also allows you to retrieve various date-related information.

int year = ethiopianCalendar.Year(); // Output: 2015
int month = ethiopianCalendar.Month(); // Output: 4
int day = ethiopianCalendar.Day(); // Output: 23
int quarter = ethiopianCalendar.Quarter(); // Output: 2
string monthName = ethiopianCalendar.MonthName(); // Output: "ታኅሣሥ"
string weekDay = ethiopianCalendar.WeekDay(); // Output: "እሑድ"
bool isLeapYear = ethiopianCalendar.IsLeapYear(); // Output: true
int fiscalYear = ethiopianCalendar.FiscalYear(); // Output: 2014
int fiscalMonth = ethiopianCalendar.FiscalMonth(); // Output: 10

Date Formatting

V1.2.0 and above also support for date formatting

DateTime gregorianDate = new DateTime(2024, 4, 2);
EthiopianCalendar ethiopianCalendar = new EthiopianCalendar(gregorianDate);
string ethiopianDate = ethiopianCalendar.Date(format: "dddd, dd MMMM yyyy");
Console.WriteLine(ethiopianDate); //ሀሙስ, መጋቢት 26 2016

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.1 89 4/3/2024
1.2.0 77 4/3/2024
1.0.0 181 7/20/2023