xsoh / moment-hijri

A Hijri calendar (Based on Umm al-Qura calculations) plugin for moment.js
http://momentjs.com/docs/#/plugins/hijri/
MIT License
200 stars 82 forks source link

Uncaught TypeError: s.indexOf is not a function #56

Open zorzv opened 4 years ago

zorzv commented 4 years ago

I'm using moment to make a calendar and this line is throwing the above error:

ev.date = moment(ev.eventTime, "YYYY-MM-DD");

where eventTime is: {eventName: 'Interview - Jr. Web Developer', calendar: 'Work', color: 'orange', eventTime: moment("2020-05-16")},

The calendar works without moment-hijri dependency but I want to add hijri dates to the calendar.I haven't parsed hijri dates so far.

This line from moment-hijri.js is throwing the error:

string = string.slice(string.indexOf(parsedInput) + parsedInput.length)