Diff is not a function in Moment.js
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am selecting a date in the Air Datepicker and trying to compare today's date to the selected date to determine the difference in days. So, for example, if today is 12/11/2016 and I select 12/20/2016, I want to get the difference, which is 9. I keep running into the following error: "end.diff is not a function". I've stripped the following code down to the essentials: HTML <form> <input id="datereq" name="datereq" type="text" class="dateReq" value="" /> </form> <div id="selected"></div> JQUERY var date = new Date(), disabledDays = [0, 6]; $