Welcome to PI Square. Firstly, in general, the 'Master PI' space is generally for questions that are related to the courses in the space. For your question, it would belong more appropriately to the 'PI Developers Club' space.
To answer your question, you can add ThisDisplay.SetTimerange(st,et) to the ContextChanged event that is fired by the ContextHandler. I believe this will achieve your purpose.