Forráskód Böngészése

feat(yongren-talent-management): 使用 dayjs 格式化入职日期

- 添加 dayjs 依赖
- 入职日期格式从 toLocaleDateString 改为 YYYY-MM-DD
- 确保日期格式统一规范

🤖 Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 1 hete
szülő
commit
f42dddd989

+ 1 - 0
mini-ui-packages/yongren-talent-management-ui/package.json

@@ -56,6 +56,7 @@
     "@tarojs/plugin-platform-weapp": "4.1.4",
     "@tarojs/react": "4.1.4",
     "@tarojs/taro": "4.1.4",
+    "dayjs": "^1.11.18",
     "hono": "4.8.5",
     "react": "^18.0.0",
     "react-dom": "^18.0.0"

+ 2 - 1
mini-ui-packages/yongren-talent-management-ui/src/pages/TalentManagement/TalentManagement.tsx

@@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react'
 import { View, Text, Input, ScrollView } from '@tarojs/components'
 import Taro from '@tarojs/taro'
 import { useQuery, useQueryClient } from '@tanstack/react-query'
+import dayjs from 'dayjs'
 import { YongrenTabBarLayout } from '@d8d/yongren-shared-ui/components/YongrenTabBarLayout'
 import { PageContainer } from '@d8d/mini-shared-ui-components/components/page-container'
 import { Navbar } from '@d8d/mini-shared-ui-components/components/navbar'
@@ -338,7 +339,7 @@ const TalentManagement: React.FC<TalentManagementProps> = () => {
                         </Text>
                       </View>
                       <View className="mt-2 flex justify-between text-xs text-gray-500">
-                        <Text>入职: {talent.latestJoinDate ? new Date(talent.latestJoinDate).toLocaleDateString() : '未入职'}</Text>
+                        <Text>入职: {talent.latestJoinDate ? dayjs(talent.latestJoinDate).format('YYYY-MM-DD') : '未入职'}</Text>
                         <Text>薪资: {formatSalary(talent.salaryDetail)}</Text>
                       </View>
                     </View>

+ 3 - 0
pnpm-lock.yaml

@@ -2776,6 +2776,9 @@ importers:
       '@tarojs/taro':
         specifier: 4.1.4
         version: 4.1.4(@tarojs/components@4.1.4(@tarojs/helper@4.1.4)(@types/react@18.3.26)(html-webpack-plugin@5.6.4(webpack@5.91.0))(postcss@8.5.6)(rollup@3.29.5)(vue@3.5.22(typescript@5.9.3))(webpack-chain@6.5.1)(webpack-dev-server@4.15.2(webpack@5.91.0))(webpack@5.91.0))(@tarojs/helper@4.1.4)(@tarojs/shared@4.1.4)(@types/react@18.3.26)(html-webpack-plugin@5.6.4(webpack@5.91.0))(postcss@8.5.6)(rollup@3.29.5)(vue@3.5.22(typescript@5.9.3))(webpack-chain@6.5.1)(webpack-dev-server@4.15.2(webpack@5.91.0))(webpack@5.91.0)
+      dayjs:
+        specifier: ^1.11.18
+        version: 1.11.18
       hono:
         specifier: 4.8.5
         version: 4.8.5