Add the options 'first-day' and 'no-extra-rows'.

The first-day attribute sets the first day of the week.
The no-extra-rows attribute disables adding empty rows to the calendar.

What do you think in naming this function `buildDates`?

I would also avoid a "boolean trap" (http://ariya.ofilabs.com/2011/08/hall-of-api-shame-boolean-trap.html), and change the last 2 arguments for an `options` parameter that should come as an object.