Bragg's law generalized to time-space periodic media