2013-12-12 109 views
1

我有這個奇怪的問題與momentjs。我有在一個字符串日期的輸入,以填補該輸入我用:將字符串轉換爲Moment對象

var result1 = moment(this._d).format("L") 

現在我需要讀它的值並再次將其轉換爲一個時刻對象:

var result2 = moment(result1 , "L") 

好,我覺得一切都應該是好的,但即時通訊的地方失去的日期......該RESULT2是01-01-0000

檢查這個簡單的測試日期,看看我的意思是:

moment(this._d).format("L") ==> "20-01-1900" 
moment(moment(this._d).format("L"), "L").format("L") ==> "01-01-0000" 

回答

1

我使用的是2.0.0版本,剛試過版本2.4.0,這沒有發生。