fix bugs and add a calendar for input query date