This is a modified version of the Time Since Last widget by hannesfostie that is a bit simplified and with the red-green inverted (goes red when too much time has passed).
It does not use HTML local storage (no need, the server remembers it for us) and the threshold is just called 'threshold' and it is in hours.