'How to detect the current viewport's timeframe?

Not just that it's below hour-level (timeframe.isminutes and timeframe.multiplier < 60 stuff) but the actual current timeframe itself.



Solution 1:[1]

It sounds like you are looking for the built-in variable timeframe.period.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vitruvius