[FIX] base_calendar: improve the code