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
<PackageReference Include="tetri.net.CalendarVersioning" Version="0.0.3" />
<PackageVersion Include="tetri.net.CalendarVersioning" Version="0.0.3" />
<PackageReference Include="tetri.net.CalendarVersioning" />
paket add tetri.net.CalendarVersioning --version 0.0.3
#r "nuget: tetri.net.CalendarVersioning, 0.0.3"
#:package tetri.net.CalendarVersioning@0.0.3
#addin nuget:?package=tetri.net.CalendarVersioning&version=0.0.3
#tool nuget:?package=tetri.net.CalendarVersioning&version=0.0.3
CalendarVersioning
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:
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - 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 | Versions 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. |
-
net9.0
- System.Text.Json (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.