Hide alarm based on time

I had a widget where the alarm would display the next alarm in the next 12 hours. So it the alarm time was more than 12 hours away, then it was hidden. My 3 year old accidentaly deleted it, and for the life of me I can't remember how I did it. Any suggestions?

Use this:

$if(tf(si(alarmd), H) < 12, "Next alarm at: " + df("hh:mm", si(alarmd)), "")$

Which translates to "if time left (tf) from next alarm is less than 12 hours (H) then write next alarm at..., otherwise write nothing