What work was the basis for the play and movie On the Town (1949)?

The story of three sailors in On the Town (1949) on a twenty-four-hour leave in New York City was based on the ballet Fancy Free by Jerome Robbins.

The movie starred Gene Kelly, Frank Sinatra, and Jules Munshin.