contract Date {

    bytes32 constant private JANUARY = keccak256("Jan");
    bytes32 constant private FEBRUARY = keccak256("Feb");
    bytes32 constant private MARCH = keccak256("Mar");
    bytes32 constant private APRIL = keccak256("Apr");
    bytes32 constant private MAY = keccak256("May");
    bytes32 constant private JUNE = keccak256("Jun");
    bytes32 constant private JULY = keccak256("Jul");
    bytes32 constant private AUGUST = keccak256("Aug");
    bytes32 constant private SEPTEMBER = keccak256("Sep");
    bytes32 constant private OCTOBER = keccak256("Oct");
    bytes32 constant private NOVEMBER = keccak256("Nov");
    bytes32 constant private DECEMBER = keccak256("Dec");

    /// @return the number of the month based on its name.
    /// @param _month the first three letters of a month's name e.g. "Jan".
    function _monthToNumber(string _month) internal pure returns (uint8) {
        bytes32 month = keccak256(abi.encodePacked(_month));
        if (month == JANUARY) {
            return 1;
        } else if (month == FEBRUARY) {
            return 2;
        } else if (month == MARCH) {
            return 3;
        } else if (month == APRIL) {
            return 4;
        } else if (month == MAY) {
            return 5;
        } else if (month == JUNE) {
            return 6;
        } else if (month == JULY) {
            return 7;
        } else if (month == AUGUST) {
            return 8;
        } else if (month == SEPTEMBER) {
            return 9;
        } else if (month == OCTOBER) {
            return 10;
        } else if (month == NOVEMBER) {
            return 11;
        } else if (month == DECEMBER) {
            return 12;
        } else {
            revert("not a valid month");
        }
    }
}
/// @title Date provides date parsing functionality.
function _monthToNumber(string _month) internal pure returns (uint8) {
    bytes32 month = keccak256(abi.encodePacked(_month));
    if (month == JANUARY) {
        return 1;
    } else if (month == FEBRUARY) {
        return 2;
    } else if (month == MARCH) {
        return 3;
    } else if (month == APRIL) {
        return 4;
    } else if (month == MAY) {
        return 5;
    } else if (month == JUNE) {
        return 6;
    } else if (month == JULY) {
        return 7;
    } else if (month == AUGUST) {
        return 8;
    } else if (month == SEPTEMBER) {
        return 9;
    } else if (month == OCTOBER) {
        return 10;
    } else if (month == NOVEMBER) {
        return 11;
    } else if (month == DECEMBER) {
        return 12;
    } else {
        revert("not a valid month");
    }
}

/// @return the number of the month based on its name.
/// @param _month the first three letters of a month's name e.g. "Jan".