In this Hinative question about the best way to translate the simple small-talk phrase "I hope you had a good weekend", two native Japanese speakers both reply with a "...ことと思います" pattern: 「いい週末だったことと思います。」「よい週末を過ごしたことと思います。」 (Although they also note that a question-form 「いい週末でしたか」 would also be natural.)
I can't find anything about a "...ことと思います" grammar pattern, and I'm racking my brain trying figure out why this pattern would equate to "I hope that..." in English. What does this pattern actually express? How else might I use it in Japanese?