fix bugs in ui.calendar