Skip to Content
Menu
This question has been flagged
1 Reply
649 Views

I would like to create a date filter in the "Tomorrow" rental module. 

There is a "Today" filter.

datetime.datetime.combine(context_today(), datetime.time(0, 0, 0)) to datetime.datetime.combine(context_today(), datetime.time(23, 59, 59))

 

Avatar
Discard
Best Answer

Try this:  

# Function to return tomorrow's date 

def context_tomorrow(): 

      return datetime.date.today() + 

datetime.timedelta(days=1) 

# Start of tomorrow  

start_of_tomorrow = 

datetime.datetime.combine(context_tomorrow(), 

datetime.time(0, 0, 0)) 


# End of tomorrow 

end_of_tomorrow =

datetime.datetime.combine(context_tomorrow(), 

datetime.time(23, 59, 59))

Avatar
Discard