Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
660 Widoki

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))

 

Awatar
Odrzuć
Najlepsza odpowiedź

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))

Awatar
Odrzuć