Preskoči na glavni sadržaj
← 📄 HTML & the platform·Modul A3 · Lekcija 4
ZadatakBuild an event form: <input name='date' type='date' min='2026-01-01'> and <input name='time' type='time'>.

Unosi datuma/vremena

75 XP7 min
Teorija

Native pickers — no jQuery datepicker needed

<input type="date" name="dob" />                  <!-- 2026-05-20 -->
<input type="time" name="alarm" />                <!-- 14:30 -->
<input type="datetime-local" name="meeting" />    <!-- 2026-05-20T14:30 -->
<input type="month" name="month" />               <!-- 2026-05 -->
<input type="week" name="week" />                 <!-- 2026-W21 -->

Every modern browser ships a calendar/clock picker. The user types or picks; the value submitted is ISO 8601.

ISO 8601 is the only format

Don't put format hints in placeholders like "MM/DD/YYYY". The browser localizes display to the user's locale automatically — they see "May 20, 2026" in en-US, "20 Mai 2026" in de-DE, "20/05/2026" in en-GB. The value that gets posted is always YYYY-MM-DD.

min and max work

<input type="date" name="dob" max="2026-05-20" />   <!-- can't pick a future date -->
<input type="date" name="appt" min="2026-06-01" max="2026-12-31" />

datetime-local has no timezone

The submitted value is 2026-05-20T14:30 with no Z or offset. The browser sends it in the user's local time, and your backend must store the user's timezone separately (or assume UTC). Use type="datetime-local" for "wall clock" times (meetings, alarms) and a server-side picker for absolute UTC instants.

🔒

Registriraj se i počni kodirati

Teorija je otvorena svima. Editor, pregled uživo i provjera otključavaju se s 7-dnevnim besplatnim probnim periodom — potrebna kartica, otkaži kad god.

Registracija — besplatan probni period →

Prvih 10 lekcija u svakom smjeru je besplatno. Bez kartice.

← PrethodnaSljedeća lekcija →

Jedan Python ili web savjet dnevno — emailom

Kratko, ručno pisano, bez spama. Odjavi se jednim klikom.