Fix parsing bug in calendar