# DateInput Integration with JSON

Generally, the data which is received from the server is serialized in a [JSON](http://www.json.org/) format.

The date object in JSON is an [ISO8601](https://en.wikipedia.org/wiki/ISO_8601)-formatted date string. For more details, refer to the documentation on the [`JSON.stringify`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify) method. On the other hand, the DateInput works only with JavaScript [`Date`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) instances.

To bind the DateInput to dates which are serialized as strings, handle the parsing process:

1. Convert the JSON date strings into valid JavaScript `Date` objects by using the `IntlService` or any other suitable `Date` parser.
2. Define the [`value`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/dateinputcomponent#value) input property of the component—the same approach applies to reactive and template-driven forms.
3. Wire the [`valueChange`](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/dateinputcomponent#valuechange) output property of the DateInput to get the selected `Date` value.

> note JavaScript's `Date` constructor treats date-only strings (for example, `"2024-06-30"`) as UTC midnight, not as local time. When you convert such a string to local time, users in timezones behind UTC may see the wrong date. To avoid this issue, parse date-only strings using the date component constructor: `new Date(year, month - 1, day)`. For more information, refer to the [MDN documentation on creating Date objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#several_ways_to_create_a_date_object).

The following example demonstrates how to set the value of the DateInput.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/dateinputs/dateinput/json/source.txt)

## Suggested Links

* [API Reference of the DateInput](https://www.telerik.com/kendo-angular-ui-develop/components/dateinputs/api/dateinputcomponent)
* [Supported Date and Number Formats](https://github.com/telerik/kendo-intl/tree/master/docs)
