To say He spent the whole night requires several words in English. It's only one word in the Greek: dianuktereuo. The word is significant. It speaks of enduring at a task through the night. The word could not be used of sleeping all night. It's not an expression you would use if you wanted to say it was dark all night. It has the sense of toiling through the night, staying at a task all night. It suggests that He remained awake through the darkness until morning and that He was persevering all that time in prayer with an immense weight of duty upon Him.