User Story
As a Developer,
I want a utility class to convert a month's name to its corresponding numerical representation, So that I can easily work with date-related logic in a more standardized format.
Codes
public class DateUtility {
public static Integer GetMonthinNumber(String MonthinWord){
switch on MonthinWord {
when 'January'{
return 1;
}
when 'February'{
return 2;
}
when 'March'{
return 3;
}
when 'April'{
return 4;
}
when 'May'{
return 5;
}
when 'June'{
return 6;
}
when 'July'{
return 7;
}
when 'August'{
return 8;
}
when 'September'{
return 9;
}
when 'October'{
return 10;
}
when 'November'{
return 11;
}
when 'December'{
return 12;
}
when else {
return null;
}
}
}
}
Video
Video does not exists.