for the visa, better get it before the travel to avoid furture hassles.

but i would suggest that you let the baby grow old a few months more before you take him/her travelling on an airplane. just imagine even an adult do have some problms with air pressure inside the cabin of an aircraft, what more would a few weeks old or a month old baby feel about this? (he/she'll be crying all the way to your destination) if that's the case.