MeroMiti 1.0.0

dotnet add package MeroMiti --version 1.0.0
                    
NuGet\Install-Package MeroMiti -Version 1.0.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="MeroMiti" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MeroMiti" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MeroMiti" />
                    
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 MeroMiti --version 1.0.0
                    
#r "nuget: MeroMiti, 1.0.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.
#:package MeroMiti@1.0.0
                    
#: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=MeroMiti&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MeroMiti&version=1.0.0
                    
Install as a Cake Tool

<p align="center"> <a href="https://meromiti.com" target="_blank" rel="noopener noreferrer"> <img src="https://meromiti.com/app-icon.png" width="80" height="80" alt="Mero Miti Logo" style="border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);" /> </a> </p>

Mero Miti .NET & C# (MeroMiti)

Official Mero Miti (मेरो मिति) library for .NET and C#. Features ultra-compressed 24-bit Bikram Sambat calendar data (< 1 KB), bidirectional AD $\leftrightarrow$ BS conversions, runtime dynamic year registration, and ASP.NET Core [BsDate] model validation attributes.


📦 Installation

dotnet add package MeroMiti

Supports .NET Standard 2.0, .NET 6.0, .NET 7.0, .NET 8.0, and .NET 10.0+.


🚀 Quick Start

1. Basic Conversions

using MeroMiti;

// Gregorian (A.D.) to Bikram Sambat (B.S.)
BsDate todayBs = MeroMitiCore.AdToBs(DateTime.UtcNow);
Console.WriteLine(todayBs); // 2081-05-19
Console.WriteLine(MeroMitiCore.FormatBsDate(todayBs, "DD/MM/YYYY", numeral: "ne")); // १९/०५/२०८१

// Bikram Sambat (B.S.) to Gregorian (A.D.)
DateTime adDate = MeroMitiCore.BsToAd(new BsDate(2081, 5, 19));
Console.WriteLine(adDate.ToString("yyyy-MM-dd")); // 2024-09-04

2. Nepali Fiscal Year (आर्थिक वर्ष) & Quarters

// Current Fiscal Year
var fy = MeroMitiCore.GetFiscalYear();
Console.WriteLine(fy.Code);       // "2081/82"
Console.WriteLine(fy.NepaliCode); // "२०८१/८२"

// Exact Gregorian and BS Boundaries
var range = MeroMitiCore.GetFiscalYearRange(2081);
Console.WriteLine($"{range.StartBs} to {range.EndBs}"); // 2081-04-01 to 2082-03-31

// Financial Quarters (त्रैमासिक)
var quarters = MeroMitiCore.GetFiscalYearQuarters(2081);
foreach (var q in quarters)
{
    Console.WriteLine($"{q.Name}: {q.StartBs} to {q.EndBs}");
}

3. Strict Calendar Validation

var result = MeroMitiCore.ValidateBsDate(new BsDate(2081, 1, 32), locale: "ne");
if (!result.IsValid)
{
    Console.WriteLine(result.Error); // 2081 साल बैशाखमा 31 दिन मात्र छन्
}

3. ASP.NET Core Model Validation

Annotate your DTOs or ViewModels with [BsDate]:

using System.ComponentModel.DataAnnotations;
using MeroMiti.Attributes;

public class EmployeeRegistrationDto
{
    [Required]
    public string FullName { get; set; } = string.Empty;

    [Required]
    [BsDate(Format = "DD/MM/YYYY", Locale = "ne")]
    public string DateOfBirthBs { get; set; } = string.Empty;
}

4. Dynamic Runtime Year Registration

// Register newly published calendar year at runtime
MeroMitiCore.RegisterYear(2095, "bba445");
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 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.  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 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.

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.0.0 45 10/23/2026