xarray.DataArray.dt.daysinmonth

DataArray.dt.daysinmonth

The number of days in the month