私は時間と分を表す2つのinput
フィールドを持っています。入力番号フィールドの先行ゼロを表示します
<input type="number" min="0" max="24" step="1" value="00" class="hours">
<input type="number" min="0" max="0.60" step="0.01" value="00" class="minutes">
どちらとして表示:
0:0
または:
5:3
それを表示する方法はありますように:
00:00
または:24時間のデータ形式の
05:03
すなわち(人々がそれを示唆する前に、私はタイプ= "時間" を使用することはできません)。
このスレッドをチェックするhttp://stackoverflow.com/questions/14638018/current-time-formatting-with-javascriptそれはあなたがやっていることではありませんが、JavaScriptの書式設定は時間と分で動作するはずです。 –
が重複していますか? http://stackoverflow.com/questions/20684737/force-lead-zero-in-number-input –
実際にはこれは次のとおりです:http://stackoverflow.com/questions/6312993/javascript-seconds-to-time-string-with -format-hhmmss –