I understand that a lunar day is about 13 & half earth days, and so also the lunar night. Since there is no atmosphere on moon, the surface temperature during "lunar day" reaches upto +127 degree Centigrade. Was the LM and the space suits for EVA designed for this?
Not fully. By design the landing was early moon local morning both for optimal lighting for the landing and for reasonable temperatures. In practice the sub zero shadow temperature was more of a problem, including when one of the lunar rovers was parked in the shade and caused the batteries to chill below intended limits. The long day length allowed several earth day missions to take place before the surface temperature peaked.
In looking at the 127 temperature the lack of atmosphere still means that the only path for that heat is via feet/landing legs so is a solvable engineering problem that is relatively minor compared to dealing with the direct heat radiation from the sun and much easier than operating in an actual atmosphere at 127 degrees would be since radiation and evaporative cooling still work. The surface temperature could be a problem for an injured astronaut stuck sitting or lying on the surface.