NepaliCalendarBS 1.1.6

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

// Install NepaliCalendarBS as a Cake Tool
#tool nuget:?package=NepaliCalendarBS&version=1.1.6                

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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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.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.1.6 979 4/30/2024
1.1.5 3,565 2/3/2022
1.1.4 548 9/12/2021
1.1.3 315 9/6/2021
1.1.2 481 4/22/2021

Minor updates in code