vikramlearning / blazorbootstrap

An Enterprise-class Blazor Bootstrap Component library built on the Blazor and Bootstrap CSS frameworks.
https://docs.blazorbootstrap.com/
Apache License 2.0
670 stars 32 forks source link

DateInput - DateChanged #820

Open FernandoAugustoAf opened 1 month ago

FernandoAugustoAf commented 1 month ago

Hey guys!

I'm trying to retrieve the Date Input value when used in a blazor custom component but I'm not having success. Could someone help me with this please?

//** //START -- BLAZORPAGE.razor //**

@code { public DateOnly? date1 { get; set; } private void OnClickSave() { date1 = date1; DateOnly? NewValue = date1; NewValue = NewValue; } }

//END-- BLAZORPAGE.razor

//** //START -- MyComponent.razor //**

@code {

[Parameter]
public DateOnly? date1 { get; set; }

public void DateChanged(DateOnly? newValue)
{
    date1 = newValue;
}

public void ChangeDate() => date1 = DateOnly.FromDateTime(DateTime.Now.AddDays(3));

}

//END-- MyComponent.razor

Grateful!

gvreddy04 commented 1 month ago

@FernandoAugustoAf Thank you for using BlazorBootstrap. Please share a sample GitHub repository with minimal steps to reproduce the issue.

FernandoAugustoAf commented 1 month ago

Sorry for not providing the necessary data earlier.

Below is the project link. https://github.com/FernandoAugustoAf/DateInput

My intention is to retrieve the selected DATEINPUT value when clicking the CLICK button

Gratefull