Skip to content

DateTimePicker

Lucisano edited this page Nov 5, 2019 · 2 revisions

Features

  • Ability to manually enter date
  • Ability to select date from drop down
  • Ability to hook into DateChanged event/action
  • Ability to specify DateTimeFormat as parameter (default set as "dd/MM/yyyy")

Example Implementation

@using BlazorComponents.Components

<!-- Vanilla Implementation -->
<DateTimePicker />

<!-- Date Time format "if ya nasty" Implementation -->
<DateTimePicker DateTimeStringFormat="MM/dd/yy" />

<!-- Will stop the Tile window closing after selecting a date -->
<DateTimePicker CloseDateTileWindow="false"/>

Example Event Handling

HTML/Razor

@page "/"
@inherits TestPageBase
@using BlazorComponents.Components

<DateTimePicker DateChanged=@HandleDateChanged/>

C#

public class TestPageBase : ComponentBase
{
    public void HandleDateChanged(DateTime date)
    {
        //do stuff;
    }
}

Clone this wiki locally