For calendar spread positions taken before expiry day, the margin benefit will be removed on the day of expiry before markets open.
While for any calendar spread positions taken on expiry day, you won’t get any margin benefit.
Btw, this is applicable only for positions expiring on that day.
Quoting example form here: SEBI's circular for tightening rules for F&O trading
For example: Let us assume the monthly expiry is on the 29th (current month), 30th (next month), and 31st (far month) respectively, then calendar spread positions involving positions expiring on the 29th (current month) and 30th (next month), or 29th (current month) and 31st (far month), shall not be provided calendar spread treatment on 29th (current month expiry). However, calendar spread positions involving positions expiring on the 30th (next month) and 31st (far month) shall continue to receive calendar spread treatment on the 29th (current month expiry).