Skip to content

Commit

Permalink
docs(datepicker): Update DateTimeOffset KB
Browse files Browse the repository at this point in the history
  • Loading branch information
dimodi committed Jul 14, 2023
1 parent 8730dc6 commit c200d62
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions knowledge-base/date-input-picker-datetimeoffset.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ Can I use a `DateTimeOffset` field with the Telerik date input and picker?
Do the Telerik DateInput, DatePicker, DateTimePicker, TimePicker support the `DateTimeOffset` type?

## Answer
The Telerik date and time inputs and pickers can work with a `DateTimeOffset` type and with the `DateTime` types. They can also be nullable.
The Telerik DateInput, DateTimePicker and TimePicker can work with `DateTimeOffset` and `DateTime` types. The types can also be nullable. When the `Value` is of type `DateTimeOffset` these Telerik components will use its `.DateTime` field, which matches to the local time, just like with a "simple" `DateTime` object.

When the `Value` is of type `DateTimeOffset` the Telerik components will use its `.DateTime` field, which matches to the local time, just like with a "simple" `DateTime` object.
The DatePicker requires a [different approach. See the Notes below](#notes).

For the DatePicker component, see the [Notes](#notes) below

>caption Sample of how the Telerik Date-Time inputs work with a DateTimeOffset
>caption Sample of how the Telerik DateTime inputs work with a DateTimeOffset
````CSHTML
@if(TheValue != null)
Expand All @@ -45,9 +43,9 @@ For the DatePicker component, see the [Notes](#notes) below
}
<TelerikDateInput @bind-Value="@TheValue" Format="F" Width="400px" />
<br /><br />
<br />
<TelerikTimePicker @bind-Value="@TheValue" Format="F" Width="400px" />
<br />
<TelerikDateTimePicker @bind-Value="@TheValue" Format="F" Width="400px" />
@code{
Expand Down

0 comments on commit c200d62

Please sign in to comment.