1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-17 01:42:41 +02:00

Minor modifications to #627

This commit is contained in:
Steve Heffernan
2013-08-26 16:23:33 -07:00
parent 75dd7c5a3c
commit acb4a43d8a
2 changed files with 2 additions and 1 deletions

View File

@ -461,7 +461,7 @@ vjs.formatTime = function(seconds, guide) {
gh = Math.floor(guide / 3600);
// handle invalid times
if (window['isNaN'](seconds) || seconds === Infinity) {
if (isNaN(seconds) || seconds === Infinity) {
// '-' is false for all relational operators (e.g. <, >=) so this setting
// will add the minimum number of fields specified by the guide
h = m = s = '-';

View File

@ -197,6 +197,7 @@ test('should format time as a string', function(){
test('should format invalid times as dashes', function(){
equal(vjs.formatTime(Infinity, 90), '-:-');
equal(vjs.formatTime(NaN), '-:-');
// equal(vjs.formatTime(NaN, 216000), '-:--:--');
equal(vjs.formatTime(10, Infinity), '0:00:10');
equal(vjs.formatTime(90, NaN), '1:30');
});