How to use the umi-plugin-react/locale.formatDate function in umi-plugin-react

To help you get started, we’ve selected a few umi-plugin-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github umijs / umi / packages / umi-ui / client / src / components / Logs / index.tsx View on Github external
export const Log = logItem => {
  const { type, date, message } = logItem;

  // const formatDate = moment(date).isValid() ? moment(date).format('YYYY-MM-DD HH:mm:ss') : '';
  const messageGroup = message.split('\n');
  return (
    <li>
      
        {typeof type === 'string' ? type.toLocaleUpperCase() : 'UNKNOW'}
      
      <p>
        {formatDate(date, {
          year: 'numeric',
          month: 'numeric',
          day: 'numeric',
          hour: 'numeric',
          minute: 'numeric',
          second: 'numeric',
        })}
        &nbsp;&nbsp;
      </p>
      <div>
        {messageGroup.map((msg, i) =&gt; (
          <p>
            
              {msg}
            
          </p></div></li>

umi-plugin-react

React plugin set for umi.

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages