javascript - Deprecation warning: moment construction falls back to js Date -


I use the following code to convert server-side date-time to local time using Moment.js The moment (moment) (moment ('Mercury, 23 April 2014 09:54:51 +0000'). Format ('LL')) .nan ()

But I'm getting "Refraction Warning: The moment creation JS falls back on the date, it is frustrated and will be removed in the upcoming major release. For more information, please visit https://github.com View / moment / moment / issues / 1407 "!

It seems that I can not get rid of it !!
How can I fix this ??

Thanks in advance.

/ div>

To get rid of the warning, you either need the following:

  • In an ISO-formatted version of your date string:

    moment ('2014-04-23T0 9: 54: 51');

  • Now you have to pass in the string, but tell the moment how the format of the string is:

    the moment (' Mercury, 23 April 2014 09:54:51 +0000 ',' ddd, DD MMM YYYH H: mm: SS Z '); D

  • Convert your string to a JavaScript date object and then pass it to the prompt:

    Moment (new date ( "Mercury 23 last resort warning console with a built-in fallback which supports the moment now, like they say they will not support the fallback in future releases. they explain that new date ('My date') is very unpredictable . < / Div>

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -