--- layout: post title: '' date: 2018-08-31 17:05:50 +0800 --- Just found a bug which occurs with probability 1/60. Fixed code (MCVE): function f() { var input = document.querySelector("input[type=time]"); var time = input.value; /* added this: */ if(time.length === "hh:mm".length) { time += ":00"; } doStuffWithTime(time); }