How can I group entries based on a dateTime field?
You're currently grouping on the myDate field, which essentially creates a new array index for each date (e.g. 2016-01-01) which is why you're getting your current output.

To group by year, this should do the trick:

{% for year, entries in entries|group('myDate.year') %}
    &lt;h4&gt;{{ year }}&lt;/h4&gt;
    &lt;ul&gt;
        {% for entry in entries %}
            ...
        {% endfor %}
    &lt;/ul&gt;
{% endfor %}