Custom date sorting

Hello,
I want to sort a time column which can be displayed either as “33s” or “1m23s” (random values for example).
How can I do this with AG-grid?

I tried using a valueGetter, but it doesn’t work:
options.configure_column("Flight time", valueGetter={"function": "d3.time.format.multi([['%-Ss', function(d) { return d.getSeconds(); }], ['%-Mm%Ss', function(d) { return d.getSeconds(); }]])"},filter="agDateColumnFilter")

Do you have any other ideas?
Thanks for your suggestion !