A Persian (Jalali) DatePicker control for Windows Forms applications built with .NET 10.
- Persian (Jalali) calendar
- Right-to-left (RTL) support
- Persian digit display
- Today button
- Clear button
- Calendar dialog for date selection
- Nullable
DateOnlyvalue - Simple WinForms integration
- Compatible with Entity Framework Core
- Suitable for applications using SQLite and other EF Core providers
- .NET 10
- Windows Forms
- Windows
Install the package using the .NET CLI:
dotnet add package PersianDatePicker.WinFormsOr install it from the NuGet Package Manager in Visual Studio.
Add the following namespace:
using PersianDatePicker.WinForms.Controls;Create the control:
var datePicker = new PersianDatePicker
{
Width = 250
};
Controls.Add(datePicker);You can also set an initial value:
datePicker.Value = DateOnly.FromDateTime(DateTime.Today);The selected date is available through the Value property:
DateOnly? selectedDate = datePicker.Value;Because the property is nullable, it can also contain null when no date is selected.
You can assign a DateOnly value directly:
datePicker.Value = new DateOnly(1405, 6, 18);Set Value to null to clear the selected date:
datePicker.Value = null;The control also provides a Clear button inside the calendar dialog.
The calendar dialog provides a Today button that selects the current date.
The ValueChanged event is raised whenever the selected date changes:
datePicker.ValueChanged += (sender, e) =>
{
DateOnly? selectedDate = datePicker.Value;
};The control returns a DateOnly? value, which can be assigned directly to an Entity Framework Core entity property.
For example:
public class Order
{
public long Id { get; set; }
public DateOnly OrderDate { get; set; }
}You can assign the selected date:
order.OrderDate = datePicker.Value!.Value;Then save the entity normally using Entity Framework Core:
db.Orders.Add(order);
await db.SaveChangesAsync();Because the control returns DateOnly, dates can be used directly in Entity Framework Core queries.
var date = new DateOnly(1405, 6, 18);
var orders = await db.Orders
.Where(x => x.OrderDate == date)
.ToListAsync();var fromDate = new DateOnly(1405, 6, 1);
var toDate = new DateOnly(1405, 6, 31);
var orders = await db.Orders
.Where(x =>
x.OrderDate >= fromDate &&
x.OrderDate <= toDate)
.OrderBy(x => x.OrderDate)
.ToListAsync();The selected date is displayed using the Persian calendar and Persian digits.
Example:
۱۴۰۵/۰۶/۱۸
The displayed format does not change the underlying value. The control still exposes the selected date as:
DateOnly?A simple Windows Forms example:
using PersianDatePicker.WinForms.Controls;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
var datePicker = new PersianDatePicker
{
Location = new Point(30, 30),
Width = 250
};
datePicker.Value = DateOnly.FromDateTime(DateTime.Today);
Controls.Add(datePicker);
}
}MIT License
Copyright (c) 2026 Saeed Noruzi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.