-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Diploma (frontend) +JS: fix after 1 review
- Loading branch information
MalakhN
committed
Jul 10, 2023
1 parent
1a5cfc9
commit 6ab6195
Showing
5 changed files
with
30 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export function movieLengthConv(mins) { | ||
const hours = Math.floor(mins / 60); | ||
const minutes = mins % 60; | ||
|
||
if (mins < 60) { | ||
return `${mins} минут` | ||
} else if (minutes > 0) { | ||
return `${hours}ч ${minutes}м`; | ||
} else if (hours = 1) { | ||
return `${hours} час`; | ||
} else if (hours != 1 && hours <= 4) { | ||
return `${hours} часа`; | ||
} else { | ||
return `${hours} часов`; | ||
} | ||
} |