Fixed critical bug to calendar encoding