Is "field" always "due_date##"?
If so you could use .substring(8, 11) to get the number for your second variable (though it would still be a string "31" and not really a number until you make it one).
For the first one you could maybe match a pattern?
var textchars=/([\w_]+)/; //assuming you only ever have letters and underscores
var a=field.replace(textchars, $1);
Maybe easier to use matching regexes for both?
var a=field.replace(pattern, $1);
var b=field.replace(pattern, $2);
I dunno what all you have, and I expect my solutions to be clunky at best : ) My pattern is assuming field is always letters/underscores followed by numbers.