Param DateRange fails

This code fails and says:
datetime.datetime’ object is not iterable

   time_range = param.DateRange(dt.datetime(2017,1,1),bounds=bounds )
   mag_range  = param.Number(6.0, bounds=(0.0, 8.0))
   @pn.depends( 'time_range', 'mag_range' )

Can you tell me why?

The DateRange Parameter requires a tuple as its default value, you’re only providing a datetime object. You should check what type of object you want the Parameter to hold, i.e. a tuple (=> DateRange) or a datetime (=> Date)?

1 Like