when change date and if offline, get data from indexedDB