changed to datetime from string  for filter in period