【发布时间】:2021-11-21 19:02:00
【问题描述】:
目前我正在尝试使用工作正常的 moment.js 计算他的天数,但是当我尝试格式化日期时出现错误。
这是我的 jsfiddle link
$fromDate.datepicker().on('change', function () {
$toDate.datepicker('option', 'minDate', $(this).val());
$numberDays.val(calculateDateDiff($toDate.val(), $(this).val()));
$fromDate.format('YYYY-MMM-DD');
});
错误
TypeError: $fromDate.format is not a function
这是我正在查看的日期格式 22-Nov-2021
【问题讨论】: