I'm so used to the idea of a calendar being set in (proverbial) stone. The idea of playing around with the months to that degree is almost unthinkable. And then Caesar stepped in to help:
Again, this is all shrouded in legend and tradition, but the story is that Numa Pompilius, the likely mythical second king of Rome, reformed the calendar by adding January and February to the beginning of the year and attempting to switch things back to a lunar calendar. Complicating matters was the Roman belief that odd numbers were lucky, so Numa made eight months last 29 days and four others be 31 days longs for a total of 356 days.
But, of course, that was an even number, rather defeating the point of the whole odd-obsessed exercise, so one month was made even and, to minimize the bad fortune, shorter than all the others. And if you're going to pick a shortest, unluckiest month, I think everyone in the northern hemisphere can agree that there is no more perfect candidate for that dubious honor than February. Adding a leap month of 27 days and shortening February for an extra-long year of 377 or 378 days every so often kept Numa's calendar on track with the solar year.
And that fixed things. Mostly. They still had to fix the whole leap year thing. Which they did in the 16th century. (I'm not sure if we'll read about that at all.) As I said, the whole article is worth reading.
By the time Julius Caesar had assumed his title of "dictator in perpetuity" in 46 BCE, the calendar was badly out of alignment and nobody was really sure what day it was anymore. Caesar's time in Egypt had brought him into contact with the scholars of Alexandria, who informed him that some centuries prior a Greek scholar - either Cleostratus in the 5th century or Eudoxus of Cnidus in the 4th, we're not sure which - had determined the true length of the year was just about 365.25 days long. The historians Plutarch and Pliny the Elder, both writing about a century later, say that upon his return to Rome Caesar enlisted the aid of the Mediterranean world's greatest philosophers and mathematicians to implement a new calendar, with the Alexandrian astronomer Sosigenes getting the main credit for the new calendar.
The result of all this was something very close to the calendar we use today, as two days were added to January, Sextilis - later renamed August by Caesar's successor, who not coincidentally was named Augustus - and December to bring them up to 31 days, and a single day was added to April, June, September, and November to get them to 30. It should be pointed out that the most logical thing to do would probably have been to have seven 30-day months and five 31-day months to get to 365, but for reasons that are likely lost to history Caesar decided to keep February just 28 days long, giving it the small consolation of a leap day every four years to keep the calendar in line with the year.