timrwood/moment — pull request #283 by mattiasrunge (2012-04-23 18:27:55+00:00)
Title: Added generic functions endOf and startOf

Hi,

I have created generic endOf and startOf methods that fill the same purpose as the methods eod and sod but not just for days. You supply a string parameter 'years', 'months', 'days', 'hours', 'minutes' or 'seconds' and get the end or start of the year or month for example.
Also changed the existing eod and sod methods to use the generic methods to reduce duplication.

Unit tests added and passed in the sod_eod.js.

I think this is a usefull feature which reduces the code needed to do it for a user of the library.

Thank you!
Mattias