This answer is to give a better understanding of this warning
Deprecation warning is caused when you use moment to create time object, var today = moment();
.
If this warning is okay with you then I have a simpler method.
Don't use date
object from js
use moment
instead. For example use moment()
to get the current date.
Or convert the js
date object to moment
date. You can simply do that specifying the format of your js
date object.
ie, moment("js date", "js date format");
eg:
moment("2014 04 25", "YYYY MM DD");
(BUT YOU CAN ONLY USE THIS METHOD UNTIL IT'S DEPRECIATED, this may be depreciated from moment
in the future)