javascript - Is there a possible way to write current month and year in timeline script? -
i have timeline script, , want, script work current month.
var timeline = new timeline("timeline", new date("mar 2013"));
i need replace "mar 2013" "mar 2014", dont want write hand. mean, in future, script should automaticaly current year , month. possible?
thanks of answers!
"is possible?"
of course.
using new date()
without arguments gets date object (full) current date, so:
var timeline = new timeline("timeline", new date());
or if want midnight on first day of current month:
var = new date(); var timeline = new timeline("timeline", new date(now.getfullyear(), now.getmonth()));
Comments
Post a Comment