{#if showHours}
{
if (typeof hours === 'string') {
hours = parseInt(hours);
}
if (hours >= 0) {
} else if (hours < 0) {
hours = 0;
} else {
hours = 0;
}
}}
on:keypress={onKeyPress}
on:focusin={() => {
countKeyPress = 0;
}}
on:change
/>
:
{/if}
{
if (typeof minutes === 'string') {
minutes = parseInt(minutes);
}
if (minutes >= 0 && (minutes <= 59 || !showHours)) {
} else if (minutes < 0) {
minutes = 0;
} else if (showHours && minutes > 59) {
minutes = 59;
} else {
minutes = 0;
}
minutes = minutes.toString().padStart(showHours ? 2 : 1, '0');
}}
on:keypress={onKeyPress}
on:focusin={() => {
countKeyPress = 0;
}}
on:change
/>
:
{
if (typeof seconds === 'string') {
seconds = parseInt(seconds);
}
if (seconds >= 0 && seconds <= 59) {
} else if (seconds < 0) {
seconds = 0;
} else if (seconds > 59) {
seconds = 59;
} else {
seconds = 0;
}
seconds = seconds.toString().padStart(2, '0');
}}
on:keypress={onKeyPress}
on:focusin={() => {
countKeyPress = 0;
}}
on:change
/>