Skip to content

Commit a4ebd7a

Browse files
docs(dateInput): explain behavior with nullable and non-nullable binding
1 parent e4ed155 commit a4ebd7a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

components/dateinput/overview.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ To use a Telerik Date Input for Blazor, add the `TelerikDateInput` tag.
3232
}
3333
````
3434

35-
The date input provides the following features:
35+
>caption The date input provides the following features:
3636
3737
* `Class` - the CSS class that will be rendered on the `input` element.
3838
* `Enabled` - whether the `input` is enabled.
@@ -42,6 +42,29 @@ The date input provides the following features:
4242
* `Width` - the width of the `input`. See the [Dimensions]({%slug common-features/dimensions%}) article.
4343
* Validation - see the [Input Validation]({%slug common-features/input-validation%}) article.
4444

45+
>caption The behavior of the component will depend on the type of field it is bound to, and this can result in different user experience and values that it will output:
46+
47+
##### Bound to a Nullabe DateTime
48+
49+
* When value is `null` - the `Format` is displayed as a placeholder.
50+
* When modifying a part, if some parts are not defined, the value remains `null`.
51+
* When all values are provided, the value changes.
52+
* Upon deleting any part, the whole value changes to `null`, and all input returns to the format placeholder.
53+
* When inside an `EditForm`, if no attributes are present on the field, and the value is deleted, no validation error is shown.
54+
55+
56+
57+
##### Bound to a Non-Nullabe DateTime
58+
59+
* When the value is undefined, it defaults to `0001-01-01`, so the component has it as a value.
60+
* When modifying a part, if some parts are not defined, the bound value does not change.
61+
* When all values are provided, the value changes.
62+
* Upon deleting any part, only that part switches to the format placeholder.
63+
* When inside an `EditForm`, if no attributes are present on the field, and the value is deleted, a validation error is shown.
64+
65+
66+
67+
4568

4669
>caption Example of using validation to prompt the user for certain input
4770

0 commit comments

Comments
 (0)