function to use moment js in react code example Example: moment for react npm install --save moment react-moment