将所选日期从 Kendo UI DateTimePicker 传递到 moment.js
Passing selected date from Kendo UI DateTimePicker to moment.js
我正在使用 Kendo UI DateTimePicker,其中 returns 选择的日期格式如下:
Thu Dec 15 2016 23:23:30 GMT-0500
我的目标是像这样将此日期传递给 moment.js 以获得日期:
var momentDate = moment(selectedDate);
var moneyDayStr = momentDate.format('dddd');
但是,momentDate 最终默认为今天的日期,因为 selectedDate 被认为是无效格式。
我正在使用 Kendo UI DateTimePicker,其中 returns 选择的日期格式如下:
Thu Dec 15 2016 23:23:30 GMT-0500
我的目标是像这样将此日期传递给 moment.js 以获得日期:
var momentDate = moment(selectedDate);
var moneyDayStr = momentDate.format('dddd');
但是,momentDate 最终默认为今天的日期,因为 selectedDate 被认为是无效格式。