Skip to content

DateInput - DateChanged #820

Open
Open
@FernandoAugustoAf

Description

@FernandoAugustoAf

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions