NepaliDateConverter.netstandard 1.0.1

Converts nepali date to english and viceversa

Install-Package NepaliDateConverter.netstandard -Version 1.0.1
dotnet add package NepaliDateConverter.netstandard --version 1.0.1
<PackageReference Include="NepaliDateConverter.netstandard" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NepaliDateConverter.netstandard --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NepaliDateConverter

It has followin methods available

public interface IDateConverter
{
ConvertedDate GetBsDateFromAdDate(int adYear, int adMonth, int adDate);
DateTime GetAdDateFromBsDate(int bsYear, int bsMonth, int bsDate);
}

And Returns the following object

public class ConvertedDate
{
public int Year { get; set; }
public int Month { get; set; }
public int Day { get; set; }
}

TO use it, register singleton service in startup.cs as below

services.AddSingleton<IDateConverter,DateConverter>();  

And inject IDateConverter into constructor of any class where you want to convert the date

private IDateConverter _dateConverter;

public HomeController(IDateConverter dateConverter){
_dateConverter = dateConverter;
}

public IActionResult Index(){
var bsDate = _dateConverter.GetBsDateFromAdDate(2019,09,21);
var bsYear = bsDate.Year;
var bsMonth = bsDate.Month;
var bsDay = bsDate.Day;
}

NepaliDateConverter

It has followin methods available

public interface IDateConverter
{
ConvertedDate GetBsDateFromAdDate(int adYear, int adMonth, int adDate);
DateTime GetAdDateFromBsDate(int bsYear, int bsMonth, int bsDate);
}

And Returns the following object

public class ConvertedDate
{
public int Year { get; set; }
public int Month { get; set; }
public int Day { get; set; }
}

TO use it, register singleton service in startup.cs as below

services.AddSingleton<IDateConverter,DateConverter>();  

And inject IDateConverter into constructor of any class where you want to convert the date

private IDateConverter _dateConverter;

public HomeController(IDateConverter dateConverter){
_dateConverter = dateConverter;
}

public IActionResult Index(){
var bsDate = _dateConverter.GetBsDateFromAdDate(2019,09,21);
var bsYear = bsDate.Year;
var bsMonth = bsDate.Month;
var bsDay = bsDate.Day;
}

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 121 11/22/2019
1.0.0 81 11/22/2019