Calendar query

@lightsofapollo This is getting really big! Would you mind reviewing?