Add end_date condition in the show_material function