Merge pull request #149 from CrissZollo/feature-length-time
Feature: Changed the time to display in H:MIN instead of only MIN.
This commit is contained in:
commit
78130a54aa
1 changed files with 9 additions and 1 deletions
|
|
@ -117,7 +117,15 @@ const MetadataDetails: React.FC<MetadataDetailsProps> = ({
|
||||||
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.year}</Text>
|
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.year}</Text>
|
||||||
)}
|
)}
|
||||||
{metadata.runtime && (
|
{metadata.runtime && (
|
||||||
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.runtime}</Text>
|
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>
|
||||||
|
{(() => {
|
||||||
|
const r = parseInt(metadata.runtime, 10);
|
||||||
|
if (isNaN(r) || r < 60) return metadata.runtime;
|
||||||
|
const h = Math.floor(r / 60);
|
||||||
|
const m = r % 60;
|
||||||
|
return `${h}H ${m < 10 ? '0' : ''}${m}MIN`;
|
||||||
|
})()}
|
||||||
|
</Text>
|
||||||
)}
|
)}
|
||||||
{metadata.certification && (
|
{metadata.certification && (
|
||||||
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.certification}</Text>
|
<Text style={[styles.metaText, { color: currentTheme.colors.text }]}>{metadata.certification}</Text>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue