They would be eligible for the dividend. Refer to this thread -
Buyer: Eligible to receive dividends if bought before ex-date. Not eligible for dividends if bought on or after ex-date.
Seller: Eligible for dividends of sold on or after ex-date. Not eligible for dividends if sold before ex-date.