fix(story): end_date format Y-m-d H:i; fix guard comparison; remove test data
Blueprint: end_date format changed to Y-m-d H:i (same as start date) so
Admin2 uses the identical datepicker — avoids ambiguous d-m-Y input being
misread by PHP as m-d-Y.
Template guard: was comparing end_date string against page.date|date('Y-m-d')
which can never match. Now compares date-only parts of both fields:
page.header.end_date|date('Y-m-d') != page.date|date('Y-m-d')
Montalcino live page: removed test end_date '12-09-2026 00:00'.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr
This commit is contained in:
@@ -1,14 +1,15 @@
|
|||||||
---
|
---
|
||||||
title: The Long Climb to Montalcino
|
title: 'The Long Climb to Montalcino'
|
||||||
date: '2025-09-06 20:00'
|
date: '2025-09-06 20:00'
|
||||||
location_name: Montalcino
|
location_name: Montalcino
|
||||||
location_country: Italy
|
location_country: Italy
|
||||||
lat: 43.058
|
lat: 43.058
|
||||||
lng: 11.489
|
lng: 11.489
|
||||||
hero_image: hero.jpg
|
hero_image: hero.jpg
|
||||||
hero_alt: Hairpin road climbing through olive groves towards a hilltop town
|
hero_alt: 'Hairpin road climbing through olive groves towards a hilltop town'
|
||||||
published: true
|
published: true
|
||||||
---
|
---
|
||||||
|
|
||||||
The profile showed fourteen kilometres at an average of six percent. In practice it was steeper at the bottom and gentler at the top, which is the worst possible arrangement. We started climbing at two in the afternoon, which was also the worst possible decision.
|
The profile showed fourteen kilometres at an average of six percent. In practice it was steeper at the bottom and gentler at the top, which is the worst possible arrangement. We started climbing at two in the afternoon, which was also the worst possible decision.
|
||||||
|
|
||||||
[scrolly-section image="hero.jpg" alt="Empty road rising steeply through olive groves" caption="SP55 — 14km, 840m elevation gain"]
|
[scrolly-section image="hero.jpg" alt="Empty road rising steeply through olive groves" caption="SP55 — 14km, 840m elevation gain"]
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ form:
|
|||||||
header.end_date:
|
header.end_date:
|
||||||
type: datetime
|
type: datetime
|
||||||
label: End Date
|
label: End Date
|
||||||
format: 'Y-m-d'
|
format: 'Y-m-d H:i'
|
||||||
help: 'Optional — leave blank for a single-day story'
|
help: 'Optional — leave blank for a single-day story'
|
||||||
|
|
||||||
header.hero_image:
|
header.hero_image:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% set date_str = page.date|date('d M Y') %}
|
{% set date_str = page.date|date('d M Y') %}
|
||||||
{% if page.header.end_date and page.header.end_date != page.date|date('Y-m-d') %}
|
{% if page.header.end_date and page.header.end_date|date('Y-m-d') != page.date|date('Y-m-d') %}
|
||||||
{% set sd = page.date|date('d') %}
|
{% set sd = page.date|date('d') %}
|
||||||
{% set sm = page.date|date('M') %}
|
{% set sm = page.date|date('M') %}
|
||||||
{% set sy = page.date|date('Y') %}
|
{% set sy = page.date|date('Y') %}
|
||||||
|
|||||||
Reference in New Issue
Block a user