fix dateline and resampling