Change date format on X-Axis but only show date on first tick

Apologies if this has been answered already, I searched and couldn’t find anything.

We want to display time-series data where the user can zoom in and out. That means that different date formats based on zoom level need to be supported. This works by default, an example:
image

This works very nicely except that we want dates in the format YYYY-MM-DD.

I’ve been reading the documentation on tickformat and tickformatstops but neither of those supports displaying date only on the first tick when the x-axis does not span days.

How can I change the date format but still only display date on the first tick?

Thank you