Ad

How To Get Current Date In MOMENT.JS Dynamic

- 1 answer

Using Salesforce
apex:includeScript value="{!URLFOR($Resource.Fullcalendarzip, '/moment.min.js')}"

$(document).ready(function() {

    $('#calendar').fullCalendar({
    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
            },
            editable: true,
        defaultDate:  '2015-12-12',
        editable: true,
       events:[    ]
    });

How to get today's date default but defaultDate: '2015-12-12',over here its hard coded how to get the default today's date.

Ad

Answer

Just use Javascript's new Date() to get today's date.

defaultDate: new Date(),

Ad
source: stackoverflow.com
Ad