Skip to content

Commit

Permalink
fix(format): simple define
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Apr 29, 2023
1 parent a2e5305 commit 87bc94d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/app/src/use/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export const useFormat = () => {

return type === 'default'
? `${date.getFullYear()}-${date.getMonth()}-${date.getDay()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`
: `${date.getHours()}:${date.getMinutes()}`
: `${(date.getHours() < 10 ? '0' : '') + date.getHours()}:${
(date.getMinutes() < 10 ? '0' : '') + date.getMinutes()
}`
}

const actually = (type: 'default' | 'resume' | 'iso' = 'default'): string => {
Expand Down

0 comments on commit 87bc94d

Please sign in to comment.