Architect's Log

I'm a Cloud Architect. I'm highly motivated to reduce toils with driving DevOps.

input要素(type属性 = datetime)

タイムゾーンがUTCの日時用の入力フィールドを表します。

使用例

<!DOCTYPE html>
<html lang="ja">
<head>
<title>Hello! HTML5></title>
<meta charset="UTF-8">
</head>
<body>
    <form action="hoge.cgi" method="post">
        <p>
            日時:<input type="datetime" id="datetime" step="1800" />
            <input type="submit" value="送信" />
        </p>
    </form>
</body>

レンダリング

初期表示

コンボボックスクリック

コンボボックスをクリックすると、カレンダーが表示されます。

時刻横の上下ボタンクリック

時刻横の上下ボタンをクリックすると、時刻を調整することができます。

時刻エラー

step属性が"1800"なので、30分刻みでない時刻を送信しようとすると、検証エラーになります。