For all date related actions, we have moment.js lib for that which makes all that easy. See http://momentjs.com/docs/#/parsing/now/ and http://momentjs.com/docs/#/displaying/days-in-month/ for getCurrentDate and daysInMonth.