All crops have a withering time and a cushion time. The withering time is equivalent to the ripening time, and the cushion time is half of the withering time. The crops go bad in a random time within the cushion time.
example : raspberries take 2 hours to grow. then have 2 hours to be harvested then have 1 hour in which they will wither at a random time, and can no longer be harvested.