switches are exact values, not ranges, and only work off 1 variable at a time.
so the simple way of nested switches
1 2 3 4
|
switch month
case 1:
switch day
case 1: case 2: case 3: ...case19:
|
is rather clunky and horrible. you can clean it up with a total re-design, but it serves no purpose. The point of a switch is either performance (it often becomes a lookup table instead of jump chains) or exploiting fall-through in a clever way (the above 20 days of the month is using fall through but its not elegant). There is no gain to be had from redoing this as a switch.
if you have to do it anyway, because school, ..
find a way to combine month and day into unique cases.
you can build an integer using a range,
eg month*100+ coefficient*(day<=value) to get something like 1042 that would tell you its month 10 and in the range 1-19 or whatever. Then you can switch off the result which is a reduced # of cases that span the ranges automatically. there is probably some simple way to cook up your cases, but you need to play with the data a little to find one. One idea may be to convert your dates from 1-365 and split that evenly with the correct starting point. I don't know if that works or not, but it should, with maybe a correction or two / round up /round down type thing.