Plotly < 5.0.0 issue with date axis, button restyle

I have an issue with dates on the x-axis: If I update the plot with a dropdown button, they are shown in epoch times instead of regular datetime.
This issue appears only for plotly < 5.0.0. For 5.6.0 it works.
Unfortunately I cannot update the environment due to company constraints. Is there a way to get this to work also with version <5.0.0?

The dataframe to replicate the issue:

df = pd.DataFrame({
    'id':['AC1', 'AC2', 'AC3', 'AC4'],
    'airline':['DLH', 'DLH', 'DAL', 'DAL'],
    'date1' :pd.date_range('2017-02-24', periods=4, freq='M'),
    'date2' :pd.date_range('2018-02-24', periods=4, freq='M'),
    'date3' :pd.date_range('2019-02-24', periods=4, freq='M'),
    'date4' :pd.date_range('2020-02-24', periods=4, freq='M')
    })

the initial plot (dates on x-axis are correct):

fig = go.Figure()
traces = ['date1', 'date2', 'date3', 'date4']
for trace in traces:
    fig.add_trace(
        go.Scatter(
            x=df[trace],
            y=df['id'],
            mode="markers",
            name=trace
        )
    )

restyle the plot to β€œfilter” dataframe for certain value in one column (dates are in epoch time, but should be formatted in the same way as in the initial plot):

buttons = []
for airline in df['airline'].unique():
    buttons.append(dict(method='restyle',
                        label=airline,
                        args=[{
                        'x': df[df['airline'] == airline][traces].T.values,
                        'y': np.tile(df[df['airline'] == airline]['id'].T.values, (4,1))
                        }])
                    )

adjust menu and plot:

updatemenu=[]
menu=dict()
updatemenu.append(menu)
updatemenu[0]['buttons']=buttons
updatemenu[0]['direction']='down'
updatemenu[0]['showactive']=True

fig.update_layout(updatemenus=updatemenu)
fig.show()

Thank you for your help!