Determine numeric month based on actual moth
Just use an array.

var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

var m = months.indexOf('May');  // 4