Skip to content

Commit

Permalink
[fix]{DateTimeNow}: 修复一处返回当期日期错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Aug 6, 2019
1 parent 94f54a2 commit 0704c09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,17 @@ export function deepClone(obj) {
}

/**
* 获取当前日期 2019年1月1日
* 获取当前日期 2019年01月01日
*/
export function DateTimeNow() {
const date = new Date();
const Y = `${date.getFullYear()}年`;
const M = `${date.getMonth() + 1 < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1}月`;
const D = `${date.getDate()}日`;
const D = `${date.getDate() + 1 < 10 ? `0${date.getDate() + 1}` : date.getDate() + 1}日`;
return Y + M + D;
}


/**
* yyyy-MM-dd HH:mm:ss 转 2019年1月1日
*/
Expand Down

0 comments on commit 0704c09

Please sign in to comment.