How to fix date field type error?

During Visualization, in bucket aggregation, Date histogram and date range are not working and showing this error (The index pattern ap111 does not contain any of the following compatible field types: date)

Do you have date fields in your index ?

Okay that issue is fixed now. Thanks for responding.