You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
489 B
13 lines
489 B
|
3 years ago
|
import moment from 'moment'
|
||
|
|
|
||
|
|
// 日期时间格式化过滤器(2019-12-17 15:31:34)
|
||
|
|
let dateTimeFormat = (value, format = 'YYYY-MM-DD HH:mm:ss') => moment(value).format(format)
|
||
|
|
|
||
|
|
// 日期时间格式化过滤器(2019-12-17)
|
||
|
|
let dateFormat = (value, format = 'YYYY-MM-DD') => moment(value).format(format)
|
||
|
|
|
||
|
|
// 金钱格式化过滤器 (¥ 34567.99)
|
||
|
|
let moneyFormat = (value, unit = '¥') => `${unit} ${Number(value).toFixed(2)}`
|
||
|
|
|
||
|
|
export { dateTimeFormat, dateFormat, moneyFormat }
|