Q. Someone who is going to surgery on Thursday night (Lag Baomer is Sunday). Can he shave and take a haircut Thursday evening after the shekia? He keeps sefira prohibitions from Rosh Chodesh until before Shavuos?

A. On question 84 in this forum we wrote: If Lag Baomer is Sunday you can shave on Friday likvod Shabbos… You can shave from the early morning on as it is considered already Likvod Shabbos, but not from the night before (Thursday, Bein Peisach L’Shavuos p. 249). See also Nitei Gavriel Pesach 3: 49; 23 p.286
On question 279 we wrote: “When Lag Baomer occurs on Sunday you are allowed to shave and take a haircut already in the morning of Friday. Horav M. Feinstein Zt”l (M’asef Letorah Vehora’a 2, p. 19) explains that the reason for the permit is that if you would wait until Sunday, it would appear that the honor given to Lag Baomer supersedes k’vod Shabbos. Although some Poskim permit a haircut already on Thursday night (Rivevos Ephraim O.H. 1, 338 quoting Rav Binyomin Silver), Horav Shlomo Miller’s Shlit”a opinion is to be lenient in cases of need.”
Horav Shlomo Miller’s Shlit”a opinion is that in you particular case, if he can he should wait half an hour after the shekia, or delay as much as possible. If it can’t be done, he can shave already after Shekia.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit”a.