Blazor.PersianDateTimePicker 1.0.2

dotnet add package Blazor.PersianDateTimePicker --version 1.0.2                
NuGet\Install-Package Blazor.PersianDateTimePicker -Version 1.0.2                
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.PersianDateTimePicker" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Blazor.PersianDateTimePicker --version 1.0.2                
#r "nuget: Blazor.PersianDateTimePicker, 1.0.2"                
#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.PersianDateTimePicker as a Cake Addin
#addin nuget:?package=Blazor.PersianDateTimePicker&version=1.0.2

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

Blazor.PersianDateTimePicker

This project is developed on the Blazor .net 5.0 framework.


Setup

1. Create new project in blazor .net 5.0.

2. add nuget package: Blazor.PersianDateTimePicker.

3. add java script after blazor.server.js in _Host.cshtml.

<script src="_content/Blazor.PersianDateTimePicker/Init.js"></script>

like

@page "/"
@namespace Blazor.PersianDateTimeControl.UI.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
    Layout = null;
}


<html lang="fa">
<head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>

<body>
    <component type="typeof(App)" render-mode="Server" />
    <script src="_framework/blazor.server.js"></script>
    <script src="_content/Blazor.PersianDateTimePicker/Init.js"></script>
</body>
</html>

4. use in project.

Sample:

@page "/"

<h2>With event: DateTimeChanged</h2>

<Blazor.PersianDateTimePicker.DateTimePicker DateTimeChanged="ShowDate" InitialDate=DateTime.Now/>

<input @bind="_Date" />

<br />

<h2>With binding: bind-Value</h2>

<Blazor.PersianDateTimePicker.DateTimePicker @bind-Value="_DateBind"  />

<input @bind="_DateBind" />

@code
{

    private DateTime? _DateBind = DateTime.Now.AddDays(-10);

    private string _Date;
    private void ShowDate(DateTime? dt)
    {
        _Date = dt.ToString();

    }
}

Note

Input and output are based on DateTime data type

DateTimeChange is an event that returns a date with the DateTime data type when the date changes.

InitialDate: It is a property that determines the initial value.

Text: It is a property that determines the persian value.

Value: It is a property that determines the DateTime value.

shortcuts

Ctrl+Delete=Delete

Ctrl+Home=Start of day

Ctrl+End=end of day

Ctrl+Space=current time

License

MIT

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
1.0.2 293 7/10/2023

1.0.1
First Release.
1.0.2
update README.md.