Blazor.PersianDatePicker 2.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Blazor.PersianDatePicker --version 2.1.0                
NuGet\Install-Package Blazor.PersianDatePicker -Version 2.1.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="Blazor.PersianDatePicker" Version="2.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.PersianDatePicker --version 2.1.0                
#r "nuget: Blazor.PersianDatePicker, 2.1.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.
// Install Blazor.PersianDatePicker as a Cake Addin
#addin nuget:?package=Blazor.PersianDatePicker&version=2.1.0

// Install Blazor.PersianDatePicker as a Cake Tool
#tool nuget:?package=Blazor.PersianDatePicker&version=2.1.0                

PersianDatePicker

<img src="https://github.com/fericode/Blazor.PersianDatePicker/blob/master/screenshot.png">

After v2.0.0:

<img src="https://github.com/fericode/Blazor.PersianDatePicker/blob/master/screenshot2.png">

Usage:

1- Install Blazor.PersianDatePicker from Nuget.org

2- Add <script src="_content/Blazor.PersianDatePicker/datepicker.min.js" type="text/javascript"></script> to your index.html or _Host.cshtml

3- Add <link href="_content/Blazor.PersianDatePicker/datepicker.css" rel="stylesheet" /> to your index.html or _Host.cshtml

4- Add @using Blazor.PersianDatePicker to _imports.razor

5- Use the component InputPersianDatePicker

Options:

<InputPersianDatePicker 
                        // Html input element id attribute 
                        Id="myInputDatePicker" //Optional

                        // Bind input value to local variable or dto etc
                        @bind-Value="_myComponentField"

                        // Html input element name attribute
                        Name="myInputName" //Optional

                        // Control visibility of input
                        Visible="true" //Default: true

                        // Disabled make input disabled. Meaning only showing value and picker popup won't open
                        Disabled="false" //Default: false

                        // Readonly make input readonly. Meaning user cannot change the picker value e.g. by typing
                        ReadOnly="true" //Default: true

                        // Picker align relative to input
                        // Options: Align.Right | Align.Left
                        PickerAlign="Align.Right" //Default: Align.Right

                        // Show calendar icon on text input
                        ShowCalendarIcon="true" //Default: true

                        // Calendar icon position relative to input
                        // Options: IconPosition.BasedOnAlign | IconPosition.Left | IconPosition.Right
                        CalendarIconPosition="IconPosition.BasedOnAlign" //Default: IconPosition.BasedOnAlign

                        // Can be used in changing vertical position of picker popup relative to input
                        PickerOffsetTopPositionInPixels="2" //Default: 2

                        // Initial value for input set on today
                        InitialValue="false" //Default: false

                        // Calendar type for date picker including Dual, Single, etc
                        // Options: Calendar.DualModeJalaliDefault | Calendar.DualModeMiladiDefault | Calendar.SingleModeJalali | Calendar.SingleModeMiladi
                        CalendarType="Calendar.DualModeJalaliDefault" //Default: Calendar.DualModeJalaliDefault

                        // Control the digit type showing in input after selecting by picker
                        // Options: DigitType.BasedOnCalendar | DigitType.Persian | DigitType.English
                        DigitType="DigitType.BasedOnCalendar" //Default: DigitType.BasedOnCalendar

                        // Format of date to show in input after selecting by picker, e.g. 1400/01/01 or 1400-01-01
                        // Options: DateFormat.yyyy_slash_MM_slash_dd | DateFormat.yyyy_dash_MM_dash_dd
                        DateFormat="DateFormat.yyyy_slash_MM_slash_dd" //Default: DateFormat.yyyy_slash_MM_slash_dd

                        // Prevent user select date before today
                        MinDateSetOnToday="true" //Default: true

                        // Input placeholder
                        Placeholder="Select date"

                        // CSS class for input element
                        CssClass="form-control"

                        // Inline styles for input element
                        Style="border:1px solid red; width:50%"

                        // Choose a theme for changing look and feel of picker
                        // Options: PickerTheme.Default | PickerTheme.Dark | PickerTheme.Blue | PickerTheme.Cheerup | PickerTheme.RedBlack
                        // Themes can be seen in the image
                        Theme="PickerTheme.Default"

                        // Input onchange event
                        OnChange="@(() => Console.WriteLine("OK"))"
                        
                        // Input text clear event (by pressing close button)
                        OnClear="@(() => Console.WriteLine("Cleared"))" />

You can add multi instance of InputPersianDatePicker component in a page and all of them works independently without any problem

Performance:

  • js size: 35 KB ⇒ gzipped

  • css size: 5 KB ⇒ gzipped

  • dll size: 9 KB ⇒‌ gzipped

– IIS server uses compressed gzip files out of the box (as default) for Blazor Web Assembly Hosted applications. For Blazor Standalone app, though, some manual steps is required. More info

Special Thanks:

This project is ported from pwt.datepicker project with a lot of customizations and optimizations for easy and fast use for Blazor applications. Therefore, I appreciate the great effort of Reza Babakhani @babakhani and all contributors of that project

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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 was computed.  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. 
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
3.5.0 453 9/13/2024
3.4.0 104 9/13/2024
3.3.0 1,551 3/5/2024
3.2.0 1,105 11/21/2023
3.1.1 270 11/7/2023
3.1.0 128 11/7/2023
3.0.2 3,438 1/11/2023
3.0.1 339 1/9/2023
3.0.0 326 1/8/2023
2.2.0 456 12/28/2022
2.1.1 546 11/19/2022
2.1.0 1,580 6/16/2022
2.0.2 1,270 8/7/2021
2.0.1 417 8/7/2021
2.0.0 561 5/9/2021
1.0.2 496 4/19/2021
1.0.1 922 4/3/2021
1.0.0 420 4/1/2021