timrwood/moment — pull request #362 by ichernev (2012-07-15 15:29:33+00:00)
Title: Added startOf to moment.fn

his is a generalized version of sod, that works for years, months,
days, hours, minutes and seconds.

Usage

```javascript
moment().startOf('year'); // x = new Date(); x.setMonth(0); x.setDate(1); x.setHours(0, 0, 0, 0);
moment().startOf('month'); // x = new Date(); x.setDate(1); x.setHours(0, 0, 0, 0);
moment().startOf('day'); // moment().sod() OR x = new Date(); x.setHours(0, 0, 0, 0);
moment().startOf('hour'); // x = new Date(); x.setMinutes(0); x.setSeconds(0, 0);
moment().startOf('minute'); // x = new Date(); x.setSeconds(0, 0);
moment().startOf('second'); // x = new Date(); x.setMilliseconds(0);
```