Car batteries are like that. There's a definite lifespan to them, but no one keeps track of how old theirs are so they die when you don't expect it. Most autoparts and big box stores will test them for free and will give you an idea of the condition of you battery/approximation of how much longer it'll go. Once you get near the guaranteed lifespan (60/72/84 months), they'll go on for a little while, but will fail eventually. Planned obsolescence if you ask me! (Conspiracy theorist at heart.)
Glad your foot is not painful! Hobbling around favoring the other foot leads to other problems that take even longer to heal.