RORK LABJP
MAX — Rork Max is built on Claude Code and Claude Opus 4.6, generating native Swift apps directly instead of React NativeAPPLE — Rork Max targets the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageWORKFLOW — In practice, users settle into letting the AI scaffold while they rewrite the state management and data layer themselvesSEED — Rork raised a $15M seed led by Left Lane Capital in April, with Peak XV, True Ventures, and a16z Speedrun joiningPAPERLINE — Rork acquired app builder Paperline and says it will stay acquisitive to bring in engineering talentREVIEW — Three-month revisit reviews are growing, clarifying where the tool shines and where it doesn'tMAX — Rork Max is built on Claude Code and Claude Opus 4.6, generating native Swift apps directly instead of React NativeAPPLE — Rork Max targets the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageWORKFLOW — In practice, users settle into letting the AI scaffold while they rewrite the state management and data layer themselvesSEED — Rork raised a $15M seed led by Left Lane Capital in April, with Peak XV, True Ventures, and a16z Speedrun joiningPAPERLINE — Rork acquired app builder Paperline and says it will stay acquisitive to bring in engineering talentREVIEW — Three-month revisit reviews are growing, clarifying where the tool shines and where it doesn't
Articles/App Dev
App Dev/2026-06-27Advanced

When a User Rewinds the Clock, Today's Card Shouldn't Break — Day Boundaries and Streak Integrity in a Daily-Content App

Daily 'card of the day' content breaks under timezone travel and manual clock changes, showing duplicates, gaps, or lost streaks. Here is a deterministic day-key and monotonic-clock design, in real Rork (Expo) code, that keeps it solid.

Rork502Expo139Date handlingStreaksRetention design2

Premium Article

Running a daily "card of the day" app as an indie developer, I started getting the same handful of reports after a while: "I see yesterday's image again today," and "my streak suddenly reset to zero." When I dug into the conditions, the users were either traveling abroad or had just nudged their device clock forward and back to chase a reward in some game.

Daily content looks trivial — show the next item when the date changes. But the moment you trust new Date() directly, three sources of drift pour into that one spot: timezone travel, daylight saving, and manual clock changes. This is a design that funnels all of that into one place and makes "today" deterministic, written as code that runs in a Rork (Expo) app.

Decide "today" in exactly one place

The first habit to drop is calling new Date().getDate() all over the UI. The "today" you compare against drifts slightly per call site, and around midnight your display and your saved state disagree.

Instead, fold the current instant into a single YYYY-MM-DD string key (a dayKey) through one function that the whole app routes through.

// lib/dayKey.ts
// Pick one "clock" you want content to flip on, and fix it.
// For a Japan-facing daily app, Asia/Tokyo means users abroad
// still see the same "today's card" as everyone at home.
const CONTENT_TZ = "Asia/Tokyo";
 
export function dayKeyFor(date: Date, timeZone: string = CONTENT_TZ): string {
  // Intl gives the calendar date in that timezone, independent of device locale.
  const parts = new Intl.DateTimeFormat("en-CA", {
    timeZone,
    year: "numeric",
    month: "2-digit",
    day: "2-digit",
  }).formatToParts(date);
 
  const get = (t: string) => parts.find((p) => p.type === t)?.value ?? "";
  return `${get("year")}-${get("month")}-${get("day")}`; // e.g. "2026-06-27"
}
 
export function todayKey(timeZone: string = CONTENT_TZ): string {
  return dayKeyFor(new Date(), timeZone);
}

The en-CA locale is deliberate: it yields YYYY-MM-DD natively, so string comparison doubles as date ordering. Any two dayKeys compare lexically, and "2026-06-27" < "2026-06-28" always holds. Content selection, streak logic, and persistence all look only at this string.

Local time, fixed timezone, or server time

Which clock decides "today" depends on the app's character. For an indie app with no backend, asking a server every time is too heavy. Here is a practical split.

BasisBehaviorFitsWeakness
Device local timeFlips at the user's local midnightHabits, journals — the person's own day is the subjectTrusts manual clock changes verbatim
Fixed timezoneAlways flips at one region's midnight"Today's reading from Japan" — the publisher is the subjectLate-night users abroad feel a mismatch
Server timeFlips on an authoritative clockRewards/leaderboards where anti-abuse mattersNo offline, network cost, latency

For the wallpaper and wellness daily apps I run, the content itself carries a sense of "the day," so I anchor on a fixed timezone (Asia/Tokyo). Readers abroad share the same "today's card," and the support thread about "different people see different art" disappeared. A pure habit tracker, by contrast, feels more natural closing on each person's local midnight. Pick one basis and commit; do not build a branch where an empty CONTENT_TZ silently means local. Mixed bases always break later.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
A single dayKey function that no screen bypasses, plus clear criteria for choosing local time, a fixed timezone, or server time
Rollover at midnight that never gets lost, by recomputing on resume instead of trusting a setTimeout that the OS suspends
Detecting a rewound device clock with a monotonic signal so traveling users never double-count or unfairly lose a streak
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

App Dev2026-06-27
Show the In-App 'What's New' Once, Without Nagging — Version Gating and Seen State
An in-app 'What's New' screen that fires on fresh installs or shows every launch gets users annoyed. Here is a version-gated, seen-state design that delivers it exactly once to people who updated — in real Rork (Expo) code, plus a shape you reuse across multiple apps.
App Dev2026-07-07
Laying Out Variable-Height Images in Two Columns: A Masonry Wallpaper Gallery in a Rork Expo App
From why numColumns cannot pack variable-aspect images cleanly, to a dependency-free column-balancing algorithm, to keeping virtualization with FlashList masonry and a pragmatic no-dependency fallback, building a wallpaper gallery with real code.
App Dev2026-07-05
Building a One-Time Code Field in Expo — SMS Autofill and Segmented Display Together
A six-digit verification screen looks trivial, but once you account for SMS autofill, pasting, and deleting one digit at a time, it needs real care. Here is how to nail the iOS and Android autofill first, then build a segmented look on top of a single TextInput that does not break.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →