Files
intotheeast-com-content/pages/02.post/post-form.md
T
m038andClaude Opus 4.8 1cde137daa feat(post-form): native datetime-local picker + require date client-side
The stock Grav `datetime` field template is deprecated and falls back to a
plain text box, so `type: datetime` + `default: now` rendered a raw input
showing the literal word "now" — unusable. Add a theme override at
templates/forms/fields/datetime/datetime.html.twig that renders a native
<input type="datetime-local"> (real calendar+clock, great on mobile), drop
the `default: now`, and prefill the current local time from post-form.js.

Also add `date` to the existing client-side validator. Together with the
picker (which can't hold an invalid value) this stops a bad/empty date from
round-tripping to the server — which was the trigger that made Grav re-render
the managed FilePond field from the session flash as filename-only inputs and
resurrect a photo the user had removed. Grav still reformats the submitted
value to the blueprint `format: 'Y-m-d H:i'` on save, so stored dates and
folder slugs are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 20:41:49 +02:00

4.9 KiB

title, template, access, pageconfig, pagefrontmatter, form
title template access pageconfig pagefrontmatter form
New Entry post-form
site.login
true
slug_field overwrite_mode
date,title false
template published
entry true
name action enctype fields novalidate buttons process
new-entry /post multipart/form-data
name label type multiple destination limit accept
photos Photos (max 4) filepond true @self 4
image/*
name label type validate
title Title text
required
true
name label type format validate
date Date & Time datetime Y-m-d H:i
required
true
name label type rows validate
content What happened today? textarea 10
required
true
name label type placeholder
lat Latitude text tap "Get Location" below
name label type placeholder
lng Longitude text
name label type placeholder
location_city City text e.g. Kyoto
name label type placeholder
location_country Country text e.g. Japan
name label type default options
weather_desc Weather Condition select
Sunny Partly cloudy Cloudy Foggy Drizzle Rain Snow Thunderstorm
— none — ☀️ Sunny Partly cloudy ☁️ Cloudy 🌫️ Foggy 🌦️ Drizzle 🌧️ Rain ❄️ Snow ⛈️ Thunderstorm
name label type placeholder validate
weather_temp_c Temperature (°C) number tap "Get Weather" or type it
min max
-60 60
name label type default options
transport_mode How I got here select
walking bicycle bus train car plane
— not specified — 🚶 Walking 🚲 Bicycle 🚌 Bus 🚆 Train 🚗 Car ✈️ Plane
name label type classes placeholder help
hero_image Hero Image Filename text advanced-field photo.jpg Filename of the hero/header image. Leave blank to use the first uploaded photo.
name label type classes highlight default options validate
force_connect Force connector line toggle advanced-field 0 0
1 0
Yes No
type
bool
name label type classes highlight default options validate
featured Featured highlight toggle advanced-field 0 0
1 0
Yes No
type
bool
true
type value classes
submit Post Daily btn-post
add_page upload message reset
true true Entry posted successfully! true