jdtcn / BlazorDateRangePicker

A Blazor component for choosing date ranges and dates
MIT License
186 stars 34 forks source link

Two way bind #13

Closed moneosi closed 4 years ago

moneosi commented 4 years ago

Hello, after date selected, two way bind shouldn't it work?

<DateRangePicker SingleDatePicker="true"
                 class="form-control form-control-sm"
                 @bind-Value="Date"
                 placeholder="Date"></DateRangePicker>

<button class="btn btn-sm"
        type="button" @onclick="ShowDate">
    Show Date
</button>

@code
{
    DateTime Date { get; set; }

    void ShowDate() => Console.WriteLine(Date);
}

WASM: 01/01/0001 00:00:00

jdtcn commented 4 years ago

Hello. Use <DateRangePicker @bind-StartDate="Value" EndDate="Value" />

moneosi commented 4 years ago

Thanks a lot