SLO Calculation Based on Month End

Dear ALl

We have a requiremnet to calculate SLO based on number of days left in a month .

For eg if a ticket is opened on 25th, the SLO should be running till 30th and then expire .  or it shoud run for a duration of 5 days (30-25)

For eg if a ticket is opened on 5th, the SLO should be running till 30th and then expire .  or it shoud run for a duration of 25 days (30-5)

Can someone guide on how to acheive the same

Regards

AA