mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Fixed: Representation of episode start time when not starting at the full hour in am/pm notation
This commit is contained in:
parent
affd351fdf
commit
1da52d1cc8
1 changed files with 4 additions and 2 deletions
|
@ -5,15 +5,17 @@ function formatTime(date, timeFormat, { includeMinuteZero = false, includeSecond
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const time = moment(date);
|
||||||
|
|
||||||
if (includeSeconds) {
|
if (includeSeconds) {
|
||||||
timeFormat = timeFormat.replace(/\(?:mm\)?/, ':mm:ss');
|
timeFormat = timeFormat.replace(/\(?:mm\)?/, ':mm:ss');
|
||||||
} else if (includeMinuteZero) {
|
} else if (includeMinuteZero || time.minute() !== 0) {
|
||||||
timeFormat = timeFormat.replace('(:mm)', ':mm');
|
timeFormat = timeFormat.replace('(:mm)', ':mm');
|
||||||
} else {
|
} else {
|
||||||
timeFormat = timeFormat.replace('(:mm)', '');
|
timeFormat = timeFormat.replace('(:mm)', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
return moment(date).format(timeFormat);
|
return time.format(timeFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default formatTime;
|
export default formatTime;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue