-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support more search space and maxDuration format #190
Conversation
@@ -88,6 +88,20 @@ class Sessionpro extends React.Component<{}, SessionState> { | |||
}; | |||
} | |||
|
|||
convertTime = (num: number) => { | |||
let hour = Math.floor(num / 3600 % 24); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why mod 24 here? it seems there is no day unit here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
} else { | ||
return result = hour + 'h ' + min + 'min'; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function can be simplified as following:
const hour = Math.floor(num / 3600);
const min = Math.floor(num / 60 % 60);
return hour > 0 ? `${hour} h ${min} min` : `${min} min`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks very much.
support more search space;
change maxDuration and still running style.