Optical/near-infrared colours of early-type galaxies and constraints on their star formation histories