fixed segmentation fault in calendar by fixing date pointer