It is completely legal. Bear in mind that companies are under no obligation to have halfdays or paid holidays or anything of the sort. It is 100% voluntary on their part to pay you for not working on a half day. This being voluntary for them, they can put any restrictions or limitations they like on holiday/halfday pay, including the one you describe. You have no legal right to be paid for not working.