Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/milad-karimifard/persianblazordatepickercomponent

Persian date picker component for Blazor
https://github.com/milad-karimifard/persianblazordatepickercomponent

blazor blazorcomponent

Last synced: about 1 month ago
JSON representation

Persian date picker component for Blazor

Awesome Lists containing this project

README

        

**1 - First install package**

```
Install-Package PersianBlazorDatePickerComponent -Version 1.0.0
```

**2 - Reference styles**

In ***wwwroot*** folder open ***Index.html*** file and add this reference inside head tag

```html

```

**3 - Import Component**

Add the code below to **_Imports.razor** file to import the component`

```razor
@using PersianBlazorDatePickerComponent
```

**4 - Initialize Component**

For initialize the component you must use **PersianDatePicker** tag in your page. this tag require 4 property to set.

- **ref : ** instance of *PersianDatePicker* class
- **SelectedDateTimeValueChanged : ** an event fires when new value selected and return selected value (DateTime)
- returned value calendar is Gregorian
- **MinDateTime : ** Minimum value can selected by component
- Must input Gregorian Date
- **MaxDateTime : ** Maximum value can selected by component
- Must input Gregorian Date

Example :

```C#

@code
{
private PersianDatePicker theDatePicker;
DateTime selectedDateTime;

void ClickHandler(DateTime date)
{
selectedDateTime = date;
}
}
```

Now component setup successfully completed , just one more step remains. for show component in page and use it you need a button to trigger the component.

Example

```c#
Open

@code
{
private PersianDatePicker theDatePicker;
DateTime selectedDateTime;

void ClickHandler(DateTime date)
{
selectedDateTime = date;
}

private void OpenDatePicker()
{
theDatePicker.ToggleActiveDatePicker();
}
}
```