我的控制檯tomorow昨天給:Moment.js反向
相同的W/O新日期的構造:
什麼可能是錯誤的?
PS:因爲我對momentjs.com越來越控制檯相同的結果是不是與項目相關的
編輯: 要容易複製,去momentjs.com,打開控制檯,放:
moment().calendar('2016-11-27T07:31:29.000+0000'); // expecting "Sunday at 9:58 AM" getting "Tuesday at 9:58 AM"
moment().calendar('2016-11-28T07:31:29.000+0000'); // expecting "Yesterday at 9:58 AM" getting "Tomorrow at 9:58 AM"
moment().calendar('2016-11-29T07:31:29.000+0000'); // this is correct "Today at 9:58 AM"
moment().calendar('2016-11-30T07:31:29.000+0000'); // expecting "Tomorrow at 9:58 AM" getting "Yesterday at 9:58 AM"
你能檢查一下新日期(...)的分析嗎?那就是''console.log(new Date(...))''。我認爲Moment.JS解決的問題之一是日期解析在這裏和那裏表現得很尷尬。所以,我會用Moments自己的日期解析器來開始。 – tiblu
也許像這樣'moment('2016-11-28T07:31:29.000 + 0000')。calendar()'? – Andrey
@Andrey同樣的結果: moment('2016-11-28T07:31:29.000 + 0000')。calendar() 「昨天早上8:31」 – Luckylooke