@Natty
I struggled at it first. Let's take a look at the error:
TypeError: Cannot read properties of undefined (reading 'type')
Basically, the error means, "I am trying to read the property 'type' of an undefined object'.
In your case, you have an array of objects, of which you're trying to read the property type:
this.columns[index].type && this.columns[index].type === 'date'
What is surely happening is that you're trying to access an index that's not defined in the array (eg, trying this.columns[3] in an array with only 3 elements)
So what you need to debug is whether index actually exists in your array. Try console logging index as soon as you calculate it, it'll probably point you in the right direction.