if value of period is reliably a date string (even...
# suitescript
d
if value of period is reliably a date string (even as just 'Mar 2020') and/or you are checking for that first, you could just do
new Date(period).getMonth() + 1
¯\_(ツ)_/¯
👍 2