🐞 fix:修复时间格式错误

pull/505/head
preschooler 2024-08-21 14:02:38 +08:00
parent eb9a9257de
commit edc50b6f00
2 changed files with 14 additions and 14 deletions

View File

@ -56,11 +56,11 @@ export const defaultShortcuts = [
*
* @param date new Date()
* @param format
* @description format `YYYY-mm、YYYY-mm-dd`
* @description format "YYYY-mm-dd HH:MM:SS QQQQ"
* @description format "YYYY-mm-dd HH:MM:SS WWW"
* @description format "YYYY-mm-dd HH:MM:SS ZZZ"
* @description format + + "YYYY-mm-dd HH:MM:SS WWW QQQQ ZZZ"
* @description format `YYYY-mm、YYYY-MM-DD`
* @description format "YYYY-MM-DD HH:MM:SS QQQQ"
* @description format "YYYY-MM-DD HH:MM:SS WWW"
* @description format "YYYY-MM-DD HH:MM:SS ZZZ"
* @description format + + "YYYY-MM-DD HH:MM:SS WWW QQQQ ZZZ"
* @returns
*/
export function formatDate(date: Date, format?: string): string {
@ -110,7 +110,7 @@ export function getWeek(dateTime: Date): number {
* @description param 3 60 * 60* 24 * 1000 * 3
* @returns
*/
export function formatPast(param: string | Date, format = 'YYYY-mm-dd HH:MM:SS'): string {
export function formatPast(param: string | Date, format = 'YYYY-MM-DD HH:MM:SS'): string {
// 传入格式处理、存储转换值
let t: any, s: number
// 获取js 时间戳

View File

@ -23,7 +23,7 @@
<div class="flex justify-between items-center w-100%">
<span class="username">{{ item.userNickname }}</span>
<span class="color-[#989EA6]">
{{ formatPast(item.lastMessageTime, 'YYYY-mm-dd') }}
{{ formatPast(item.lastMessageTime, 'YYYY-MM-DD') }}
</span>
</div>
<!-- 最后聊天内容 -->
@ -186,11 +186,11 @@ watch(showRightMenu, (val) => {
transition: border-left 0.05s ease-in-out; /* 设置过渡效果 */
.username {
min-width: 0;
display: -webkit-box;
max-width: 60%;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
}
@ -198,14 +198,14 @@ watch(showRightMenu, (val) => {
.last-message {
width: 200px;
overflow: hidden; //
white-space: nowrap; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
}
.active {
border-left: 5px #3271ff solid;
background-color: #eff0f1;
border-left: 5px #3271ff solid;
}
.pinned {
@ -214,13 +214,13 @@ watch(showRightMenu, (val) => {
.right-menu-ul {
position: absolute;
background-color: #fff;
width: 130px;
padding: 10px;
margin: 0;
list-style-type: none; /* 移除默认的项目符号 */
background-color: #fff;
border-radius: 12px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 阴影效果 */
width: 130px;
box-shadow: 0 2px 4px rgb(0 0 0 / 10%); /* 阴影效果 */
li {
padding: 8px 16px;