32 lines
807 B
Vue
32 lines
807 B
Vue
|
<script>
|
||
|
import moment from 'moment'
|
||
|
export default {
|
||
|
methods:{
|
||
|
formatDate(d,f) {
|
||
|
return moment(String(d)).format(f)
|
||
|
},
|
||
|
formatNumber(num,chars) {
|
||
|
return parseFloat(num).toFixed(chars)
|
||
|
},
|
||
|
getDateNow() {
|
||
|
let now = new Date()
|
||
|
return now.toLocaleString('en-GB', {
|
||
|
day: '2-digit',
|
||
|
month: 'long',
|
||
|
year: 'numeric'
|
||
|
})
|
||
|
},
|
||
|
getTimeNow() {
|
||
|
let now = new Date()
|
||
|
return now.toLocaleString('en-GB', {
|
||
|
month: 'long',
|
||
|
day: '2-digit',
|
||
|
year: 'numeric',
|
||
|
hour: '2-digit',
|
||
|
minute: '2-digit',
|
||
|
second: '2-digit'})
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
</script>
|