123456789101112131415161718192021 |
- import { computed } from "vue"
- import { isDate, format } from 'date-fns';
- import { isTimestamp } from '@/utils/index.js'
- export function filterFormatDate() {
-
- const formatDate = computed(() => {
- return function(date, formatStr){
- if(isDate(date) || isTimestamp(date)){
- return format(date, formatStr);
- }else{
- return '';
- }
- }
- })
- return {
- formatDate
- };
- }
|