这里应该用that.
区分when还是that要看其在句子里充当的成分,when等关系副词,在句子里充当状语;that、which等关系代词,在句子里充当宾语或主语.
这里spent 后缺宾语,应该用关系代词,that.