When a share is sold just before the date you become entitled to a dividend, the share is sold cum-dividend. The purchaser of the share(s) then receives the dividend.