The Rise and Fall of Humor
McGraw, Williams, and Warren (2014)

...Time creates a comedic sweet spot that occurs when the psychological distance from a tragedy is large enough to buffer people from threat (creating a benign violation) but not so large that the event becomes a purely benign, nonthreatening situation. The finding can help psychologists understand how people cope and provide clues to what makes things funny and when they will be funny...