Make TimeGrid composing more generic (function).