In India, most of the companies have a specific dates for providing the salaries. So, its company specific.
For example, I worked for a company whose salary date was 10th of every month.
Now, what if its a weekend? Doesn't matter. They will pay you on the next available date.
So, if someone joins on 10th that's well and good. But, if someone joins on 12th then most of the companies will deduct the salary of 2 days unless its not a technical issue (like your case). If that's the case, then they will surely pay you the salary for full month.
Now, speaking to the resigning phase. No matter if you spend 21 days or 35 days, they will take the salary for whole month without considering any holidays or technical issues.
Though again, it depends on your employer. If you have spent some good days and have a good relation with the HR's, they will give you an excellent farewell. :)
if the employee need to pay him the salary of 31 days or 29 days.
He will pay you for the days you have worked and the lost two days wont be considered.