NepaliCalendarBS 1.1.8

There is a newer version of this package available.
See the version list below for details.
dotnet add package NepaliCalendarBS --version 1.1.8
                    
NuGet\Install-Package NepaliCalendarBS -Version 1.1.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="NepaliCalendarBS" Version="1.1.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NepaliCalendarBS" Version="1.1.8" />
                    
Directory.Packages.props
<PackageReference Include="NepaliCalendarBS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NepaliCalendarBS --version 1.1.8
                    
#r "nuget: NepaliCalendarBS, 1.1.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.
#:package NepaliCalendarBS@1.1.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NepaliCalendarBS&version=1.1.8
                    
Install as a Cake Addin
#tool nuget:?package=NepaliCalendarBS&version=1.1.8
                    
Install as a Cake Tool

NepaliCalendarBS

.NETCore Nuget package with collection of functions to work with Date in Bikram Sambat (B.S.).

Features:

  • Convert BS dates to AD and vice versa
  • Validate if the English dates & Nepali Dates are correct
  • Converts Date in Bikram Sambat (B.S.) from 1970 B.S. to 2201 B.S.
  • Generate an Array of CalendarDay[6,7] for given (Year, Month) B.S.

Installation

NepaliCalendar is build on .NET Standard 2.0 so is compaitable to .NET Core 2.0 + or .NetFramework. Install it using the Nuget Manager.

Class & Methods available

The package has one structure:

  • CalendarDay
  • WeekDay (Day of week i.e. 1->Sunday, 7->Saturday)
  • int YearBS (Year in B.S.)
  • int MonthBS (Month in B.S.)
  • int DayBS (Day in B.S.)
  • int YearAD (YearAD in A.D.)
  • int MonthAD (MonthAD in A.D.)
  • int DayAD (DayAD in A.D.)

The package has two class available. They are as follows:

  • NepaliDate
  • NepaliCalendar

NepaliDate

Class to store Bikram Sambat Date. (B.S.) with following properties:

  • int Year (Year in B.S.)
  • int Month (Month in B.S.)
  • int Day (Day in B.S.)
  • WeekDay (Day of week i.e. 1->Sunday, 7->Saturday)
Functions

  • public override string ToString() Returns NepaliDate converted as string in format yyyy/MM/dd

  • public static int CompareTwoDates(NepaliDate Date1, NepaliDate Date2) If Date1 (B.S.) is smaller returns -1, 0 for equal and 1 for greater

NepaliCalendar

This class contains static methods which can be used to convert the dates. They are as follows:


Functions
  • public static NepaliDate FixDate(string sDate) Converts Unicode Nepali numbers to english if necessary and returns valid B.S. date.
Parameters

Valid B.S. date in string

Returns

Date in B.S. in NepaliDate. If length of date == 10 returns same date else returns 1970/01/01 B.S.

  • public static string Get_Month_Name_Nepali(int iMonthInNumber) Gets first day of month as integer [Calendar Function]
Parameters

"iYear" (Integer year), "iMonth" (Integer from 1 to 12)

Returns

Integer value of total days in a month

  • public static NepaliDate TodayBS() Gets today B.S.
Returns

Date in Nepali Date format

  • public static string TodayBS_InLongString() Gets today B.S.
Returns

Date in Unicode Nepali Format (e.g. २०७७ साल श्रावण ३२ गते)

  • public static string CalculateAge(string sBSDate1, string sBSDate2, bool bInNepali) Calculates the date span (age) between two dates in Bikram Sambat (B.S.).
Parameters

"sBSDate1", "sBSDate2", "bInNepali"

Returns

Age in Year Month Day as string. If InNepali = true, बर्ष महिना दिन

  • public static int CalculateDaysFromRefYear(string sDateInBS) Calculates the no of days between 1970/01/01 B.S. and given date in B.S.
Parameters

"sDateInBS" (B.S. date in string, accepts Unicode Nepali and English)

Returns

Integer value for number of days

  • public static int CalculateDaysBetweenTwoBSDates(string sFirstDate, string sSecondDate) Calculates the no of days between given dates in B.S.
Parameters

"sFirstDate", "sSecondDate" (B.S. date in string, accepts Unicode Nepali and English)

Returns

Integer value for number of days

  • public static NepaliDate AddDaysInDateBS(string sDate, int iNoOfDays) Add some days in given date in B.S.
Parameters

"sDate", "iNoOfDays" (B.S. date in string, accepts Unicode Nepali and English)

Returns

New date in NepaliDate format

  • public static NepaliDate SubstractDaysInDateBS(string sDate, int iNoOfDays) Substracts some days from given date in B.S.
Parameters

"sDate", "iNoOfDays" (B.S. date in string, accepts Unicode Nepali and English)

Returns

New date in NepaliDate format

  • public static DateTime Convert_BS2AD(string sDateInBS) Converts date in B.S. to A.D.
Parameters

"sDateInBS" (B.S. date in string [e.g: 2077/01/01 OR २०७७/०१/०१], accepts Unicode Nepali and English)

Returns

New A.D. date in DateTime format

  • public static NepaliDate Convert_AD2BS(DateTime dtDateInAD) Converts date in A.D. to B.S.
Parameters

"dtDateInAD" → A.D. Date in DateTime format

Returns

New B.S. date in NepaliDate format

  • public static CalendarDay[,] MakeCalendar(int iYearBS, int iMonthBS) Creates a calendar
Parameters

"iYearBS" → Year in B.S. "iMonthBS" → Month in B.S.

Returns

An Array of CalendarDay[6,7]


Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • 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.3 653 5/14/2025
1.2.2 129 5/9/2025
1.2.1 150 5/8/2025
1.2.0 151 5/5/2025
1.1.9 184 4/2/2025
1.1.8 170 3/20/2025
1.1.6 1,648 4/30/2024
1.1.5 3,768 2/3/2022
1.1.4 627 9/12/2021
1.1.3 388 9/6/2021
1.1.2 568 4/22/2021

Minor updates in code