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.
22 lines
500 B
22 lines
500 B
import Vue from 'vue'
|
|
import {
|
|
date
|
|
} from '@/common/js/util'
|
|
|
|
|
|
Vue.filter('date', (timeStamp, format='Y-m-d H:i')=>{
|
|
if(!timeStamp) return '';
|
|
return date(format, timeStamp);
|
|
})
|
|
|
|
Vue.filter('friendDate', (timeStamp, format='Y-m-d H:i')=>{
|
|
if(!timeStamp) return '';
|
|
return date(format, timeStamp);
|
|
})
|
|
|
|
Vue.filter('price', (price, fixed=0)=>{
|
|
if(!price || isNaN(price)){
|
|
return 0
|
|
}
|
|
return fixed > 0 ? parseFloat(price).toFixed(fixed) : + parseFloat(price).toFixed(2);
|
|
})
|