Skip to content

Commit

Permalink
chore: update formateDate
Browse files Browse the repository at this point in the history
  • Loading branch information
LaicZhang committed Apr 21, 2022
1 parent db0fbdd commit 28c9a18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* 工具函数封装
*/
export default {
formateDate(date: any, rule: string): string {
let fmt: string = rule || 'yyyy-MM-dd hh:mm:ss'
formateDate(date: any, rule = 'yyyy-MM-dd hh:mm:ss'): string {
let fmt: string = rule
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, date.getFullYear())

Expand Down

1 comment on commit 28c9a18

@vercel
Copy link

@vercel vercel bot commented on 28c9a18 Apr 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.