“moment” has no exported member ‘default’
Try adding “allowSyntheticDefaultImports”: true to your tsconfig.json under the “compilerOptions”
Try adding “allowSyntheticDefaultImports”: true to your tsconfig.json under the “compilerOptions”
If you’re using single locale try moment(‘Thu Oct 25 2018 17:30:03 GMT+0300’).fromNow(); //eg. 1 day ago, 2 hours ago etc or moment(‘Thu Oct 25 2018 17:30:03 GMT+0300’).fromNow(true); //eg. 1 day, 2 hours for more see docs and:
If you read the docs (http://momentjs.com/docs/#/displaying/) you can find this format: moment(“2015-01-16T12:00:00”).format(“hh:mm:ss a”) See JS Fiddle http://jsfiddle.net/Bjolja/6mn32xhu/
When using moment.js, use: var tz = moment.tz.guess(); It will return an IANA time zone identifier, such as America/Los_Angeles for the US Pacific time zone. It is documented here. Internally, it first tries to get the time zone from the browser using the following call: Intl.DateTimeFormat().resolvedOptions().timeZone If you are targeting only modern browsers that support … Read more