Skip to content

Commit

Permalink
chore: fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Jun 8, 2024
1 parent 312cdb0 commit 60eba1c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/field/src/components/Second/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ export type FieldDigitProps = {
* @returns {string}
*/
export function formatSecond(result: number) {
let newResult = result;
let formatText = '';
let past = false;
if (result < 0) {
result = -result;
if (newResult < 0) {
newResult = -newResult;
past = true;
}
const d = Math.floor(result / (3600 * 24));
const h = Math.floor((result / 3600) % 24);
const m = Math.floor((result / 60) % 60);
const s = Math.floor(result % 60);
const d = Math.floor(newResult / (3600 * 24));
const h = Math.floor((newResult / 3600) % 24);
const m = Math.floor((newResult / 60) % 60);
const s = Math.floor(newResult % 60);
formatText = `${s}秒`;
if (m > 0) {
formatText = `${m}分钟${formatText}`;
Expand Down

0 comments on commit 60eba1c

Please sign in to comment.