The process was cognitive dissonance
This is the process where people have inconsistent thoughts and behave weirdly in their decision making. In this case, they correlated the prevention of the destruction of earth with their prayer, even though it had nothing to do with it. This is opposite of their previous statement which said that the world would end on that date.