Menu

A calendar is a data structure, not a UI
πŸ“°

A calendar is a data structure, not a UI

DEV Community: androidΒ·Alfred ChaosΒ·about 9 hours ago
#dpnsXWks
#devtoandroid#devto#dev#period#days
Reading 0:00
15s threshold

Most period trackers start the same way: "When did your last period start?" Then "When did it end?" You pick two dates from a date picker and the app stores a range.

We went the other way. In Mori the calendar is the input. You tap days. That's it.

That sounds like a small UX difference. It ends up changing the data model, the correction flows, and a good share of the edge cases in the app.

What a marked day means

There is one fact per day: recorded or not. No start field, no end field, no "period in progress" state.

A period is the longest run of consecutive recorded days. Length is a derived value: count the days. The gap to the previous run is the cycle length. Nothing else is stored.

Everything a user thinks of as "editing a period" becomes an edit to a set of booleans.

Three things this buys you

Merging is free. Tap Monday through Friday and you have one period of five days. No dialog asks whether Friday belongs to the previous entry or to a new one. Adjacency decides.

Splitting is free.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.