UNPKG

yzf-date-format

Version:

日期格式化

35 lines (32 loc) 1.02 kB
import React, { Component } from 'react'; import ReactDOM from 'react-dom'; import { NFormat, DFormat, AddDate, AddMonth } from '../dist'; import './index.less'; class App extends React.Component { constructor(props, context) { super(props, context); this.state = { value: '', visible: false, }; } componentDidMount() { const aa = DFormat(new Date(), 'yyyy-MM:dd hh:mm:s'); // const aa = DFormat(new Date(), 'd:MM:yyyy~hh/mm.ss', '~'); // const aa = DFormat(new Date(), ['YYYY-MM-DD', 'hh:mm:ss'], ' 33232 '); const bb = NFormat(1.21221, '0.0%'); const cc = AddDate(null, 61); const dd = AddMonth(null, 2); console.log(122121.221, aa, bb, cc, dd); } componentWillReceiveProps() { // } render() { // 活动效果监测与分析 / 辅助活动方案决策 / 圈人、圈店、圈券、圈商品 const { visible } = this.state; return (<div> 21 </div>); } } ReactDOM.render((<App />), document.getElementById('react-content'));