user3214545 user3214545 -5 years ago 156
jQuery Question

Get the first day of the current year

I have two input fields to search between dates. I want the start date to default to the first day of the current year and the end date to default to today. I have the end date but I am unsure of how to get it to dsplay the star

var defaultStart =
var defaultEnd = moment((new Date()).valueOf());

Answer Source
var thisYear = (new Date()).getFullYear();    
var start = new Date("1/1/" + thisYear);
var defaultStart = moment(start.valueOf());
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download