将所选日期从 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 被认为是无效格式。

显然现在已经弃用了,有充分的理由他们使用非 iso 字符串进行构造已被弃用,请检查它 here

因此,在我尝试 here 时,首先使用 kendo.parseDate(date,"yyyy-MM-ddTHH:mm:ss.fffZ") 将其格式化为 iso 字符串。