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
"Deprecation warning: moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to moment/moment#1407 for more info."
This usage of the moment() constructor is going to be deprecated soon. It is suggested that instead of dumping any date string into the constructor, one should instead use String + Format. For example:
Or, as is mentioned in moment/moment#1407, if one really needs to dump in random dates without specifying the format, another alternative is to let Date handle it:
For our use case -- an RSS feed reader -- I don't know if we can successfully use String + Format. RSS feeds are supposed to have a standardized date format, as shown in the RSS 2.0 specification:
All date-times in RSS conform to the Date and Time Specification of RFC 822, with the exception that the year may be expressed with two characters or four characters (four preferred).
Example: Sat, 07 Sep 2002 0:00:01 GMT
..but, my impression is that feeds in the wild don't predictably follow this standard, so anticipating what format the dates will use in any given feed is probably out of the question.
Should we go with letting Date parse the initial publishedDate string and hope for the best?
My guess is that we should, because Date is what Moment currently falls back to when the pubDate isn't ISO-8601 compliant. Using Date like this is a risky practice and doesn't always work, so they're removing this feature to wipe their hands clean of it. But, that doesn't stop us from using it.
The text was updated successfully, but these errors were encountered:
ivavictoria
added a commit
to ivavictoria/jquery-rss
that referenced
this issue
Jun 3, 2015
Moment.js is printing a warning to the console:
This is being caused by line 218 of jquery.rss.js:
This usage of the moment() constructor is going to be deprecated soon. It is suggested that instead of dumping any date string into the constructor, one should instead use String + Format. For example:
Or, as is mentioned in moment/moment#1407, if one really needs to dump in random dates without specifying the format, another alternative is to let Date handle it:
For our use case -- an RSS feed reader -- I don't know if we can successfully use String + Format. RSS feeds are supposed to have a standardized date format, as shown in the RSS 2.0 specification:
..but, my impression is that feeds in the wild don't predictably follow this standard, so anticipating what format the dates will use in any given feed is probably out of the question.
Should we go with letting Date parse the initial publishedDate string and hope for the best?
My guess is that we should, because Date is what Moment currently falls back to when the pubDate isn't ISO-8601 compliant. Using Date like this is a risky practice and doesn't always work, so they're removing this feature to wipe their hands clean of it. But, that doesn't stop us from using it.
The text was updated successfully, but these errors were encountered: