jdtcn / BlazorDateRangePicker

A Blazor component for choosing date ranges and dates
MIT License
182 stars 35 forks source link

Can't choose a single date, when the date picker was initialized. #67

Closed RyT-13 closed 2 years ago

RyT-13 commented 2 years ago
 <DateRangePicker 
    OnRangeSelect="OnDateRangeSelect" placeholder="Select dates....">
</DateRangePicker>

this allows choose single date. image

But if add the following initializing parameters: <DateRangePicker @bind-EndDate="CurrentEndDate" @bind-StartDate="CurrentStartDate" ... or <DateRangePicker StartDate="CurrentStartDate" EndDate="CurrentEndDate" ... this doesn't allow choose single date. image

jdtcn commented 2 years ago

Hi,

Maybe there is a problem with time component. Can you try it like this: <DateRangePicker StartDate="CurrentStartDate.Date" EndDate="CurrentEndDate.Date"?

RyT-13 commented 2 years ago

Yes, it really worked! But I don't understand what the problem was... Why DateTimeOffset? didn't work, but DateTime fixed this problem?)