Review maxTime: by convention to 0 if none

This commit is contained in:
Claude Brisson
2024-03-10 20:25:46 +01:00
parent 8d577f32ab
commit e5c95893ba
3 changed files with 5 additions and 7 deletions

View File

@@ -189,7 +189,7 @@
<div id="maxTime" class="three wide field #if($tour && $tour.timeSystem.type != 'FISCHER')hidden#end">
<label>Max time</label>
<span class="info"></span>
<input name="maxTime" type="text" class="duration" value="#if($tour && "$!tour.timeSystem.maxTime" != '' && "$!tour.timeSystem.maxTime" != '-1')#toHMS($tour.timeSystem.maxTime)#end"/>
<input name="maxTime" type="text" class="duration" value="#if($tour && "$!tour.timeSystem.maxTime" != '' && "$!tour.timeSystem.maxTime" != '-1' && "$!tour.timeSystem.maxTime" != '0')#toHMS($tour.timeSystem.maxTime)#end"/>
</div>
<div id="byoyomi" class="three wide field #if(!$tour || $tour.timeSystem.type != 'CANADIAN' && $tour.timeSystem.type != 'STANDARD')hidden#end">
<label>Byo-yomi time</label>

View File

@@ -73,10 +73,8 @@
if (value && /\d+:\d+:\d+/.test(value)) {
let parts = value.split(':');
let seconds = parts[0] * 3600 + parts[1] * 60 + parts[2] * 1;
console.log(`${value} => ${seconds}`);
return seconds;
}
console.log(`invalid hh:mm:ss value: ${value}`);
return 0;
}
function chooseStep(step) {