Write a program to convert dates between the [[wp:Gregorian calendar|Gregorian calendar]] and the [[wp:French Republican Calendar|French Republican calendar]].

The year 1 of the Republican calendar began on 22 September 1792. There were twelve months (Vendémiaire, Brumaire, Frimaire, Nivôse, Pluviôse, Ventôse, Germinal, Floréal, Prairial, Messidor, Thermidor, and Fructidor) of 30 days each, followed by five intercalary days or <i>Sansculottides</i> (<i>Fête de la vertu</i> / Virtue Day, <i>Fête du génie</i> / Talent Day, <i>Fête du travail</i> / Labour Day, <i>Fête de l'opinion</i> / Opinion Day, and <i>Fête des récompenses</i> / Honours Day). In leap years (the years 3, 7, and 11) a sixth <i>Sansculottide</i> was added: <i>Fête de la Révolution</i> / Revolution Day.

As a minimum, your program should give correct results for dates in the range from 1 Vendémiaire 1 = 22 September 1792 to 10 Nivôse 14 = 31 December 1805 (the last day when the Republican calendar was officially in use). If you choose to accept later dates, be aware that there are several different methods (described on [[wp:French Republican Calendar|the Wikipedia page]]) about how to determine leap years after the year 14. You should indicate which method you are using. (Because of these different methods, correct programs may sometimes give different results for dates after 1805.)

Test your program by converting the following dates both from Gregorian to Republican and from Republican to Gregorian:

• 1 Vendémiaire 1 = 22 September 1792

• 1 Prairial 3 = 20 May 1795

• 27 Messidor 7 = 15 July 1799 <i>(Rosetta Stone discovered)</i>

• Fête de la Révolution 11 = 23 September 1803

• 10 Nivôse 14 = 31 December 1805

