A Question about foal feeding

When I’m nurturing a horse, do I have to feed it before the timer runs out? Or can I build it back up as long as I have the resources before the horse grows up? I don’t want to be up all night fighting to get this single bit of feed just to ensure the horse doesn’t lose out on any bonuses