How to subtract 2 dates on momentjs

You are correct, you can use moment’s diff function to subtract two dates (see my example on Plunker): var date1 = moment(‘2016-10-08 10:29:23’); var date2 = moment(‘2016-10-08 11:06:55’); var diff = date2.diff(date1); Diff will be equal to 2252000, the number of milliseconds between the two date. See documentation for more details. You can pass a … Read more

Full humanized durations in moment.js

Moment.js is providing the fromNow function to get time durations in human readable fromat, see http://momentjs.com/docs/#/displaying/fromnow/ Example: moment([2007, 0, 29]).fromNow(); // 4 years ago moment().subtract(375, ‘days’).fromNow(); // a year ago You need to use third party lib as suggested by @Fluffy

Locale detection with Moment.js

As of momentjs documentation: By default, Moment.js comes with English locale strings. If you need other locales, you can load them into Moment.js for later use. You can change it with that: moment.locale(locale); To get the user’s locale with javascript you can do that: var locale = window.navigator.userLanguage || window.navigator.language; Refer to: http://momentjs.com/docs/#/i18n/changing-locale/ and JavaScript … Read more

Moment.js with Vuejs

With your code, the vue.js is trying to access the moment() method from its scope. Hence you should use a method like this: methods: { moment: function () { return moment(); } }, If you want to pass a date to the moment.js, I suggest to use filters: filters: { moment: function (date) { return … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)