CalendarGenerator 0.1.2
dotnet add package CalendarGenerator --version 0.1.2
NuGet\Install-Package CalendarGenerator -Version 0.1.2
<PackageReference Include="CalendarGenerator" Version="0.1.2" />
<PackageVersion Include="CalendarGenerator" Version="0.1.2" />
<PackageReference Include="CalendarGenerator" />
paket add CalendarGenerator --version 0.1.2
#r "nuget: CalendarGenerator, 0.1.2"
#:package CalendarGenerator@0.1.2
#addin nuget:?package=CalendarGenerator&version=0.1.2
#tool nuget:?package=CalendarGenerator&version=0.1.2
CalendarGenerator
CalendarGenerator is a .NET 9 library that renders event data as PNG calendar images.
It supports:
- a traditional monthly calendar;
- a mobile-friendly seven-day calendar centered on a selected date;
- chronological event ordering;
- adaptive event layouts and overflow handling;
- PNG output returned as a
byte[].
Calendar captions use Russian month and weekday names, and weeks start on Monday.
Installation
dotnet add package CalendarGenerator --version 0.1.1
Requirements
- .NET 9
- Windows x64 or Linux x64
The package references SkiaSharp and the required Windows and Linux native assets transitively.
Noto Sans is embedded in the library, so Linux and Docker consumers do not need to install system fonts or fontconfig to render Latin and Cyrillic text.
Event model
using CalendarGenerator;
var events = new List<CalendarEvent>
{
new()
{
DateStart = new DateTime(2026, 6, 19, 9, 30, 0),
Title = "Planning meeting"
},
new()
{
DateStart = new DateTime(2026, 6, 19, 14, 0, 0),
Title = "Project review"
}
};
DateStart is treated as local calendar time. No time-zone conversion is performed.
Monthly calendar
using Generator = CalendarGenerator.CalendarGenerator;
byte[] png = Generator.CreateCalendar(events, year: 2026, month: 6);
File.WriteAllBytes("calendar-month.png", png);
The default monthly image size is 1920 by 1080 pixels. The calendar contains a six-week grid and displays adjacent-month dates in gray.
Seven-day calendar
using Generator = CalendarGenerator.CalendarGenerator;
var centerDate = new DateTime(2026, 6, 19);
byte[] png = Generator.CreateCalendarWeek(events, centerDate);
File.WriteAllBytes("calendar-week.png", png);
The seven-day view contains the center date, the three previous dates, and the three following dates. Its default mobile-friendly size is 1080 by 1920 pixels.
The weekly layout adapts to busy days by using one or two columns, redistributing space from empty days, reducing text to a readable minimum, and showing an overflow counter when necessary.
Custom dimensions
var options = new CalendarRenderOptions
{
Width = 1440,
Height = 2560
};
byte[] png = Generator.CreateCalendarWeek(events, centerDate, options);
The minimum supported size is 700 by 500 pixels.
Event colors and ordering
Events are sorted by start time and title. Seven distinct light colors are used cyclically so black text remains readable. In the monthly view, events that start within the same minute can share a row.
License
CalendarGenerator is licensed under the MIT License.
Third-party dependency notices are listed in THIRD-PARTY-NOTICES.md.
| 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
- SkiaSharp (= 3.119.4)
- SkiaSharp.NativeAssets.Linux.NoDependencies (= 3.119.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Use an embedded Noto Sans font so text renders consistently in Windows and Linux containers.