working pagination and calendar