3 fixes in appointment function

1. fix some bugs in calendar view
2. enable dynamic fragment in schedule activity
3. improve performance for date query