cmc_fe/src/CommonMethods.vue

32 lines
807 B
Vue
Raw Normal View History

2023-01-19 13:44:49 +01:00
<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>