[calendar] Change switch/case to if/else