保誠-保戶業務員媒合平台
HelenHuang
2021-11-12 398068040eb64f39376bdfa6f5187920ee7f4b21
Merge branch 'master' of https://192.168.0.10:8443/r/pcalife/PAM

# Conflicts:
# PAMapp/pages/agentInfo/_agentNo.vue
修改2個檔案
新增1個檔案
36 ■■■■ 已變更過的檔案
PAMapp/nuxt.config.js 3 ●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/pages/agentInfo/_agentNo.vue 8 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/plugins/filters/date.filter.ts 25 ●●●●● 修補檔 | 檢視 | 原始 | 究查 | 歷程
PAMapp/nuxt.config.js
@@ -35,7 +35,8 @@
    '~/plugins/element-ui.js',
    { src: '~/plugins/vue-awesome-swiper.js', mode: 'client' },
    '~/plugins/service.ts',
    '~/plugins/vue-scroll-picker'
    '~/plugins/vue-scroll-picker',
    '~/plugins/filters/date.filter.ts'
  ],
  // Auto import components: https://go.nuxtjs.dev/config-components
PAMapp/pages/agentInfo/_agentNo.vue
@@ -251,11 +251,3 @@
}
</style>
function getConsultantDetail() {
  throw new Error('Function not implemented.');
}
function getConsultantDetail() {
  throw new Error('Function not implemented.');
}
PAMapp/plugins/filters/date.filter.ts
¤ñ¹ï·sÀÉ®×
@@ -0,0 +1,25 @@
import Vue from 'vue'
Vue.filter('formatDate', (value: string): string => {
  const date = new Date(value);
  const today = new Date();
  const isToday = (compareDate: Date): boolean => {
    return compareDate.getFullYear() === today.getFullYear()
          && compareDate.getMonth() === today.getMonth()
          && compareDate.getDate() === today.getDate();
  };
  const isThisYear = (compareDate: Date): boolean => {
    return compareDate.getFullYear() === today.getFullYear();
  }
  if (isThisYear(date)) {
    return isToday(date)
          ? `今天 ${date.getHours()}:${date.getMinutes()}`
          : `${date.getMonth() + 1}月${date.getDate()}日 ${date.getHours()}:${date.getMinutes()}`;
  } else {
    return `${date.getFullYear()}å¹´${date.getMonth() + 1}月${date.getDate()}日 ${date.getHours()}:${date.getMinutes()}`;
  }
})