Calculate number of days from string like '1y2m3d', '2m3d', '1y3d', '1y' or simply '3d'

I want to create some filtering system to my grid in javascript. My issue is that I have a string that contains number of years, months and days. I would like to transform this string to number of days format. I.e. 1y1m2d = 1*365+1*30+2, 1y2d = 1*365+2 or another combination like this. I’m not exactly… Read More Calculate number of days from string like '1y2m3d', '2m3d', '1y3d', '1y' or simply '3d'