Your example is incorrect; it should read 'a 40-day period'. The rule is that adjectives take no '-s'. Compare: A ten-day trip / the trip took 10 days.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.