Quicksilver.PersianDate 1.1.0

dotnet add package Quicksilver.PersianDate --version 1.1.0                
NuGet\Install-Package Quicksilver.PersianDate -Version 1.1.0                
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="Quicksilver.PersianDate" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Quicksilver.PersianDate --version 1.1.0                
#r "nuget: Quicksilver.PersianDate, 1.1.0"                
#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 Quicksilver.PersianDate as a Cake Addin
#addin nuget:?package=Quicksilver.PersianDate&version=1.1.0

// Install Quicksilver.PersianDate as a Cake Tool
#tool nuget:?package=Quicksilver.PersianDate&version=1.1.0                

Quicksilver Helpers

This repository was created by Navid Sargheiny as a simple library to utilize Persian date capabilities. It has many features, such as providing different types of Persian dates and offering means to extract Persian dates as Persian text.

Installation

Use the package manager Nuget to install Quicksilver.PersianDate.

dotnet add package Quicksilver.PersianDate

Usage

There are multiple capabilities available in this library, which I will explain below. Here are some examples of utilizing string helpers:

Persian Date Helpers

using Quicksilver.PersianDate;

            var date = new DateTime(2024, 6, 17, 12, 15, 16);
            var persianDate = date.ToPersianDate(DateFormat.yyyy_MM_dd); //  "1403/03/28"
            persianDate = date.ToPersianDate(DateFormat.yy_MM_dd);   //    "03/03/28"
            persianDate = date.ToPersianDate(DateFormat.yyMMdd);   //    "030328"
            persianDate = date.ToPersianDate(DateFormat.yyyyMMdd);   //  "14030328"
            persianDate = date.ToPersianDate(DateFormat.yyyy_MM_dd_HH_mm_ss); //  "1403/03/28 12:15:16"

            var pDateString = "date is 1403/03/28 hh 22 text";
            var date = persianDate.ToGregorianDate(); // new DateTime(2024, 6, 17);

            var firstDay = PersianDate.GetFirstDayOfSolarHijri(1403); // new DateTime(2024, 3, 20);

            var Monday = PersianDate.GetDayOfWeek(2);   //    "دوشنبه"
            var khordad = PersianDate.GetMonthName(3);  //      "خرداد"

            var date = new DateTime(2024, 6, 21, 21, 15, 16);
            var result = PersianDate.GetPersianDateText(date);      //      جمعه، اول تیر ماه یک هزار و چهارصد و سه

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  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 is compatible.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Quicksilver.PersianDate:

Package Downloads
WorkingDaysCalculator

This project has been created to calculate the number of working days between two different date and time points. Customized for calculating Iranian working days

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 127 6/27/2024
1.0.0 139 6/21/2024

Added Time parameter in ToGregorianDate method