Reputation: 3964
EDIT
Thanks to @Pointy I had a look at my scripts I found out that I had Momentjs after my own script. Fixed.
I have a strange problem with Momentjs. Moment() is undefined in some places of my code
function init_Calendar() {
var now = moment(); // undefined
/** some unrelated code here **/
}
function monthLoadSuccess(data, status, jqXHR) {
var sortedAppointments = new Array();
for (i = 0; i < data.length; i++) {
var date = moment(data[i].Date); // successfully turns ASP.NET JSON Date into Moment object
/** more code **/
}
Both methods are in the same file. When I run Firebug on the page I am able to call moment() from the console, but for some reason it is undefined on the page.
I have included
<script>
moment().format();
</script>
At the bottom of my html after momentjs, does not help.
Upvotes: 2
Views: 933
Reputation: 3964
Thanks to @Pointy I had a look at my scripts I found out that I had Momentjs after my own script.
Upvotes: 1