Integration with JSON
Generally, the data which is received from the server is serialized in a JSON format.
The date object in JSON is an ISO8601-formatted date string. For more details, refer to the documentation on the
To bind the DateTimePicker to dates which are serialized as strings, handle the parsing process:
Dateobjects by using the
IntlServiceor any other suitable
- Define the
valueinput property of the component—the same approach applies to reactive and template-driven forms.
- Serialize the form value on form submit. This step can be omitted if using Angular's
HttpClientto send the form value to a remote server as the latter serializes the body of the request by default.
The following example demonstrates how to set the value of the DateTimePicker.