Skip to content
C.W.K.
Stream
Lesson 02 of 04 · published

The Device Owns Today

~10 min · local-date, timezone, client-context, calendar

Level 0Dry Nib
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete
"Absolute time orders events; local date answers which notebook day they belong to."

What actually persists

The notebook sits beside a particular person in a particular place. The server clock may be in another zone or already on another date. For this product, Today is a device-local calendar claim.

Views are queries

The client sends an ISO local date with the draw and view request. The server validates its shape and uses it as query context while still recording absolute created timestamps for ordering and audit.

What ambiguity costs

Deriving Today from server UTC creates entries under tomorrow or yesterday near midnight. Trusting an arbitrary date without validation permits malformed buckets. Context ownership does not cancel input validation.

Collection principle. Absolute time orders events; local date answers which notebook day they belong to.

See one entry through four windows

Test “The Device Owns Today” by viewing one entry through Today, 7 days, 30 days, and calendar. State whether each view copies data or applies another predicate, and separate the questions answered by device-local date and absolute timestamp. Creating fake rows for blank days means the model has begun storing obligation.

Query it

Show a request made near midnight where server UTC and device-local date disagree, then choose the correct entry date. Include month end, year end, near-midnight creation, multiple entries on one day, and status = 'live'. Explain the predicates and indexes that produce the answer, not only the final count.

Memory should lead back

Dates and keywords make return paths without judging the writing. When search reads the same original and transcribed state and tags retain prompt provenance, one collection truly owns its history.

Code

Validate device-local calendar context·python
from datetime import date

def parse_entry_date(value: str) -> str:
    parsed = date.fromisoformat(value)
    return parsed.isoformat()

request = {"entry_date": "2030-01-02", "keywords": ["river"]}
print(parse_entry_date(request["entry_date"]))

External links

Exercise

Show a request made near midnight where server UTC and device-local date disagree, then choose the correct entry date.
Hint
Include boundary dates and blank days.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.