I am on hundred twenty years old today. Chazal teach that Tzaddikim often die on their birthdays, and so Moshe did. The Zohar teaches that that day was Shabbat. This, however, presents a problem. Later in Parashat Vayelech we read that on the last day of Moshe's life, he wrote thirteen Torah scrolls.
Commentaries suggest two answers.
First, perhaps Moshe did not really die on Shabbat, but was only buried on that day. Moshe actually died on Friday, an instant before Shabbat began. In our observance of Shabbat we add extra minutes before the day begins and extra minutes afterwards because, among other reasons, we do not know exactly what defines the beginning or end of a day. Hashem, however, does know, and it was He who buried Moshe. He knows when Shabbat ends, and He was able to bury Moshe while our ancestors were still observing Shabbat.