You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't debugged which version of moment fixed the issue, but 2.20.1 seems to work.
Not sure if this is a bug in moment, or if the formatting string is wrong ('ddd, DD MMM YYYY HH:mm:ss [+0000]')
example repro:
const{ startDate }=awaitclient.calls(sid);
if startDate (and any other date for that matter) is e.g. 'Wed, 09 Aug 2017 01:13:35 +0000' as fetched with the REST API, parseDate() m.isValid() will be false, and a string will be returned, as supposed to a date object.
that makes me thinking, why is a string being returned in the first place? was that meant to be some sort of an escape hatch? and why is the API not returning an ISO date which would make matters simpler to begin with?
The text was updated successfully, but these errors were encountered:
dnalborczyk
changed the title
moment needs an upgrade
date parser bug with moment 2.19.2
Feb 6, 2018
dnalborczyk
changed the title
date parser bug with moment 2.19.2
date parser bug with moment 2.19.3
Feb 7, 2018
twilio: v3.11.2
nodejs: v9.5.0
twilio, or rather moment (v2.19.3), is parsing certain RFC2822 dates wrong, and leaves some dates as strings, instead of a Date object.
affected code path:
twilio-node/lib/base/deserialize.js
Line 61 in 14a85ad
twilio-node/lib/base/deserialize.js
Line 10 in 14a85ad
I haven't debugged which version of moment fixed the issue, but 2.20.1 seems to work.
Not sure if this is a bug in moment, or if the formatting string is wrong ('ddd, DD MMM YYYY HH:mm:ss [+0000]')
example repro:
if startDate (and any other date for that matter) is e.g. 'Wed, 09 Aug 2017 01:13:35 +0000' as fetched with the REST API, parseDate() m.isValid() will be false, and a string will be returned, as supposed to a date object.
that makes me thinking, why is a string being returned in the first place? was that meant to be some sort of an escape hatch? and why is the API not returning an ISO date which would make matters simpler to begin with?
The text was updated successfully, but these errors were encountered: