Fill gaps for period query