function monthNum = month2number(stringMonth)
%monthNum = month2number(stringMonth)
%==========================================================================
% A simple utility that takes as input a month name, a character string,
% and outputs the number of that month as a two character string
%
% --- INPUT ---
% stringMonth - string, the month name, either the full name or the first
%               three (or more) letters (as an abbreviation)
%
% --- OUTPUT ---
% monthNum - string, a two character string that contains the number of
% that month
%
% -------------------------------------------------------------------------
% History - Orion L. Kafka
% 12-7-2017 - written
% 5-30-2018 - changed how the switch/case works to be more concise
%==========================================================================

switch lower(stringMonth(1:3))
    case 'jan'
        monthNum = '01';
    case 'feb'
        monthNum = '02';
    case 'mar'
        monthNum = '03';
    case 'apr'
        monthNum = '04';
    case 'may'
        monthNum = '05';
    case 'jun'
        monthNum = '06';
    case 'jul'
        monthNum = '07';
    case 'aug'
        monthNum = '08';
    case 'sep'
        monthNum = '09';
    case 'oct'
        monthNum = '10';
    case 'nov'
        monthNum = '11';
    case 'dec'
        monthNum = '12';
end