用moment.js格式化日期
我有这种格式的字符串: var testDate = "Fri Apr 12 2013 19:08:55 GMT-0500 (CDT)" 我想使用moment.js以这种格式mm/dd/yyyy : 04/12/2013显示它。 我尝试使用这种方法来做 moment(testDate,'mm/dd/yyyy'); 哪些错误并说there is no such method called replace?我是否以错误的方式处理此问题? 编辑: 我还应该提到我使用的是针对meteor.js打包的moment.js的预打包版本 Object [object Date] has no method 'replace' : The Exact error from the console 堆栈跟踪: at makeDateFromStringAndFormat (http://127.0.0.1:3000/packages/moment/lib/moment/moment.js?b4e3ac4a3d0794023a4410e7941c3e179398b5b0:539:29) at moment (http://127.0.0.1:3000/packages/moment/lib/moment/moment.js?b4e3ac4a3d0794023a4410e7941c3e179398b5b0:652:24) at populateProfileForEdit (http://127.0.0.1:3000/client/views/home/administration/directory/profiles/profiles.js?acfff908a6a099f37312f62892a22b40f82e5e0f:147:25) at …