Fix small bug in schedule calendar

Fixed and updated the code