Setting up Uptime from Monday untill Friday

Hi guys, I have a problem to prepare an uptime dashboard with specific panel which should show - Uptime for specific service.

I have this query.

avg_over_time((sum without ()(rabbitmq_running{namespace="monitoring"}) 

It shows uptime.
How can I set it up to show uptime for specific timeframe.
From Monday untill Friday and from 9am until 02:00am. Only for service’s working hours. Is that possible ?

If using Flux, you can use this function