tetri.net.CalendarVersioning 0.0.3

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

CalendarVersioning

NuGet Version NuGet Downloads License Github Build Status AppVeyor Build Status

A robust Calendar Versioning implementation for .NET with full support for parsing, comparison, and format customization.

📦 Installation

Install via NuGet Package Manager:

dotnet add package tetri.net.CalendarVersioning

Or add directly to your .csproj:

<PackageReference Include="tetri.net.CalendarVersioning" Version="1.0.0" />

🚀 Quick Start

Creating versions

// From string
var version = CalendarVersion.Parse("2025.04.29");

// With custom format (YY.MM.Minor)
var format = new CalendarVersionFormat("YY.MM.Minor");
var custom = CalendarVersion.Parse("25.04.1", format);

// Using constructor
var version = new CalendarVersion(year: 2025, month: 4, day: 29, minor: 1);

Comparing versions

var v1 = CalendarVersion.Parse("2025.04");
var v2 = CalendarVersion.Parse("2025.05");

if (v1 < v2) 
{
    Console.WriteLine($"{v1} is earlier than {v2}");
}

Supported operations

// Equality
bool equal = v1 == v2; 

// Comparison
bool greater = v1 > v2;

// Comparison methods
int result = v1.CompareTo(v2);

✨ Features

✅ Strict Calendar Version parsing with format validation
✅ Full version comparison support
✅ Custom formats (YYYY.MM, YY.MM.DD.Minor, etc)
✅ Overloaded operators (==, !=, <, >, ⇐, >=)
✅ Immutable and thread-safe
✅ JSON/XML serialization ready

📚 Advanced Examples

Custom format parsing

var format = new CalendarVersionFormat("YYYY.MM.Minor");
var version = CalendarVersion.Parse("2025.04.2", format);

Console.WriteLine(version.Year);  // 2025
Console.WriteLine(version.Month); // 4
Console.WriteLine(version.Minor); // 2

Comparing detailed versions

var stable = CalendarVersion.Parse("2025.04.15");
var hotfix = CalendarVersion.Parse("2025.04.15.1");

Console.WriteLine(hotfix > stable); // True

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Crafted with 🧠 by Tetri Mesquita

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
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
0.0.3 165 5/7/2025
0.0.2 134 4/29/2025