My first IBS-d event occurred at lunchtime at work. Thankfully, everyone was either working at their desk or out for lunch already, so no one noticed my distress. That happened before I realized that I was becoming IC.
Several months later, when shopping with my 80 yr old relative, I was standing in the lineup for the checkout. It was at that point, to my horror, I was very close to peeing my pants. All my life I had been able to put off the bathroom visit until I got home or to a washroom. But on this occasion, I realized that if I had even a smidgen less resolve, I would have left a puddle there on the floor. That scared me (you could also say that it scarred me!) Long story short, I eventually started wearing pull-ups when I went shopping after that. This was after a test for infection and prognosis from doctor (diabetes nerve damage).
Then several months later, when the overnight problems started, I gave in to briefs and plastic pants. Now I often wear cheap cloth-backed briefs for accident prevention during the day to save money on the pull-ups. Even so, during the day I use the toilet unless it is occupied when I really need it.