Open dandv opened 10 years ago
+1
+1
:+1:
Will fix in v2.0.
This wasn't working for me, had to change Line 19 to be
timestamp = moment.unix(timestamp);
you have to use unix
as of 1.6 I am on 2.10.3
UPDATE: If I use UNIX_TIMESTAMP(time) from MySQL, I don't need the unix, but if I convert the date in the application with coldfusion, I do need it.
So long to change this simple fix!
+1
Submitted Pull Request #55 for those that want an easy solution. In short, Moment.js no longer likes dates as strings ... so they need to be converted into an object first. Quick three line change will hopefully get reviewed ASAP :) Until then, you can check out my PR branch for the fix.
The moment library is moving away from accepting constructors of the form
moment(timestamp)
. A time format must be passed. There are three lines of code that use the old syntax:https://github.com/mattbradley/livestampjs/blob/master/livestamp.js#L27 https://github.com/mattbradley/livestampjs/blob/master/livestamp.js#L30 https://github.com/mattbradley/livestampjs/blob/master/livestamp.js#L94
timestamp
is a string at that point in code, e.g.Tue Aug 05 2014 15:50:37 GMT-0700 (Pacific Daylight Time)"
, which seems brittle. Could it be the UNIX timetamp in seconds instead, or a Date object?