Dev.to
7/22/2026

Expiring Content: Put the Deadline in the Data, Not the Prose
Short summary
The author manages sites with time-limited content (deals, sales) by storing deadlines as structured data in JSON rather than in prose, letting the build pipeline compute days remaining and filter expired entries automatically. A key design decision is basing expiry calculations on the article's last-verified survey date rather than today, avoiding assertions about unverified information. Timezone handling is critical: parsing ISO dates without an explicit offset shifts results and causes off-by-one display errors.
- •Store deadlines in JSON data, not in article prose, and let the build compute expiry
- •Base expiry on the article's last-verified date, not today, to avoid asserting unverified facts
- •Pin timezones at parse time — new Date('YYYY-MM-DD') defaults to UTC and shifts JST results by 9 hours
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



