PersianDateShamsi 1.0.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package PersianDateShamsi --version 1.0.8                
NuGet\Install-Package PersianDateShamsi -Version 1.0.8                
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="PersianDateShamsi" Version="1.0.8" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PersianDateShamsi --version 1.0.8                
#r "nuget: PersianDateShamsi, 1.0.8"                
#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 PersianDateShamsi as a Cake Addin
#addin nuget:?package=PersianDateShamsi&version=1.0.8

// Install PersianDateShamsi as a Cake Tool
#tool nuget:?package=PersianDateShamsi&version=1.0.8                

Persian Date Library

Persian Date Library

Persian Data Library is a library that can be convert Gregorian (Milady) year to Solar Hijri (Shamsi) year in simplest way!


Target Branch Version
Github master v1.0.8

Persian Date Public Version

Target Branch Version Download link Total downloads CI Build Status CD Build Status
Nuget master v1.0.8 NuGet NuGet downloads Build Status Build Status
Release master v1.0.8 Build Status Build Status Build Status

Cross Platform

Platform Supported Version
.NET 8.0

Code Example

PersianDateShamsi persianDateShamsi = new PersianDateShamsi();
    
    Console.WriteLine(persianDateShamsi.GetShamsiYear(DateTime.Now));
    //Result : 1398
    
    Console.WriteLine(persianDateShamsi.GetShamsiMonthName(DateTime.Now));
    //Result : بهمن
    
    Console.WriteLine(persianDateShamsi.GetShamsiDayString(DateTime.Now));
    //Result : 03
    
    Console.WriteLine(persianDateShamsi.GetShamsiDayName(DateTime.Now));
    //Result : پنجشنبه
    
    Console.WriteLine(persianDateShamsi.GetShamsiDayShortName(DateTime.Now));
    //Result : پ

Extension Method For DateTime


    Console.WriteLine(DateTime.Now.ToShamsiDate());
    //Result : 1398/11/03
    
    Console.WriteLine(DateTime.Now.ToShortShamsiDate());
    //Result : 98/11/03
    
    Console.WriteLine(DateTime.Now.ToLongShamsiDate());
    //Result : پنجشنبه 3 بهمن 1398

Version changes

Version 1.0.8

-Add support for .Net 8.0

Version 1.0.4

-Add support for .Net 5.0 and 6.0

Version 1.0.3

-Change .Net Standard 2.0 To .NET 7.0

Version 1.0.2

-Improve Flexibility

Version 1.0.1

-Change .Net Standard 2.1 To 2.0 To Support More Platforms

CI Pipeline

The CI pipeline is now integrated into the CD pipeline and is defined in .github/workflows/CI.yml. It uses macos-latest as the VM image. The pipeline handles manual triggers, pull requests, and releases. It restores NuGet packages, builds the solution, runs tests, and validates the NuGet package. The pipeline installs .NET version 8.0.x to ensure compatibility with all targeted frameworks.

CD Pipeline

The CD pipeline is defined in .github/workflows/CD.yml and uses macos-latest as the VM image. It includes steps for creating, validating, testing, and deploying the NuGet package. The pipeline handles manual triggers, pull requests, and releases. It uses environment variables for the NuGet directory and the latest versions of GitHub Actions for checkout, setup-dotnet, and upload-artifact. The pipeline installs .NET version 8.0.x to ensure compatibility with all targeted frameworks. Additionally, it includes a step to delete existing tags if they already exist before creating a new release to avoid the 'Validation Failed: already_exists' error. The step now handles the case where the tag deletion fails and ensures the deletion step successfully removes the existing tag before proceeding to create a new release. The fetch_changes step now uses pwsh syntax: $PREV_TAG = $(git describe --tags --abbrev=0 HEAD^). The pipeline now also triggers on push to tags.

Requirements

  • .NET 8.0 SDK

Setup and Run

  1. Install .NET 8.0 SDK: Download and install the .NET 8.0 SDK from the official .NET website.

  2. Restore Dependencies: Open a terminal or command prompt in the project directory and run:

    dotnet restore
    
  3. Build the Project: Build the project by running:

    dotnet build
    
  4. Run Tests: Run the tests to ensure everything is working correctly:

    dotnet test
    
Product Compatible and additional computed target framework versions.
.NET 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.
  • net8.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.8.0 129 10/3/2024
1.3.0 114 9/12/2024
1.2.0 96 9/12/2024
1.0.8 100 9/12/2024
1.0.7 90 9/12/2024
1.0.6 96 9/12/2024
1.0.5 94 9/12/2024
1.0.4 345 5/16/2023
1.0.3 151 5/16/2023
1.0.2 953 1/24/2020
1.0.1 449 1/24/2020
1.0.0 537 1/23/2020
0.0.0-alpha.0.46 51 9/12/2024
0.0.0-alpha.0.45 59 9/12/2024
0.0.0-alpha.0.43 54 9/12/2024

Add support for .Net 8.0