Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
666 Vizualizări

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

 

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează