Just to chime in, I think that @krishnakernel ’s question is about simply not showing periods without data (rather than the time range being wrong). I.e. similar to this question Set time range for panel dynamically (autofocus, autozoom). Can you confirm @krishnakernel?
At the moment there is no functionality to automatically fit the time range to the returned data.