Skip to content

Commit

Permalink
Date Dropdown component added - Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
emregokrem authored Mar 25, 2024
1 parent 7f59d5d commit 8f191df
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public partial class Index
- [Checkbox](#checkbox)
- [Chip](#chip)
- [Content Header](#content-header) **(since v0.3.3)**
- [Date Dropdown](#date-dropdown)
- [Date Picker](#date-picker)
- [Date Time Picker](#date-time-picker)
- [Divider](#divider)
Expand Down Expand Up @@ -720,14 +721,39 @@ chart1.InitialChart(object1);
</ContentHeader>
```

## Date Dropdown
```razor
<DateDropdown Id="datedropdown1" DateRangeId="last-7" Format="MM/dd/yyyy" DateRangeOptions="_dateRangeOptions" DateRangeChangeEvent="Callback"></DateDropdown>
```
```csharp
readonly DateDropdownOption[] _dateRangeOptions =
{
new()
{
Id = "last-7",
Label = "Last 7 days",
From = DateTime.Today.AddDays(-7).ToString("MM/dd/yyyy"),
To = DateTime.Today.ToString("MM/dd/yyyy")
},
new()
{
Id = "today",
Label = "Today",
From = DateTime.Today.ToString("MM/dd/yyyy"),
To = DateTime.Today.ToString("MM/dd/yyyy")
}
};

private void Callback(DateDropdownResponse selectedDateDropdown)
{
Console.WriteLine(selectedDateDropdown.Id);
}
```

## Date picker

```razor
<DatePicker From="2023/02/01"
To="2023/02/15"
Id="timepicker1"
DateChangeEvent="(date) => DateChangeEventTest(date)">
</DatePicker>
<DateDropdown Id="MyDateDropdown"></DateDropdown>
```

## Date time picker
Expand Down

0 comments on commit 8f191df

Please sign in to comment.