Skip to content

Instantly share code, notes, and snippets.

@asharimh97
Created October 18, 2020 01:38
Show Gist options
  • Save asharimh97/13309fd18114b1620e8a2caa5d290600 to your computer and use it in GitHub Desktop.
Save asharimh97/13309fd18114b1620e8a2caa5d290600 to your computer and use it in GitHub Desktop.
import moment from "moment";
/**
* This function uses moment as its date formatter because
* we reuse `moment.js` which being used as one of ANTD's dependency.
*
* But if you want to change both ANTD date formatter and this function
* please take a look here first:
* https://ant.design/docs/react/replace-moment
*/
const generateLog = (message, date) => {
return `LOG: [${moment(date).format("dddd, D MMM YYYY")}]: ${message}`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment