[habit][library] Habit: the local day with rollover, days read, the forgiving weekly streak, the reminder schedule, medals as a pure function of the log; sessions carry their UTC offset
This commit is contained in:
@@ -83,6 +83,7 @@ pub fn op(r: &mut Rng, dev: &str, n: usize) -> Op {
|
||||
},
|
||||
13 => Op::Return { loan: format!("l-{dev}-{}", n.saturating_sub(1 + r.below(4) as usize)), date },
|
||||
14 => Op::Session {
|
||||
offset_min: None,
|
||||
id: format!("s-{dev}-{n}"),
|
||||
book,
|
||||
start: 1000,
|
||||
|
||||
@@ -32,6 +32,7 @@ fn yearly_and_all_time() {
|
||||
e(Op::ReadStart { book: "a".into(), read: "r4".into(), date: Some("2026-01-01".into()) }),
|
||||
e(Op::ReadEnd { read: "r4".into(), date: Some("2026-01-20".into()), outcome: Outcome::Read }),
|
||||
e(Op::Session {
|
||||
offset_min: None,
|
||||
id: "s1".into(),
|
||||
book: "a".into(),
|
||||
start: 0,
|
||||
@@ -41,6 +42,7 @@ fn yearly_and_all_time() {
|
||||
date: "2025-01-10".into(),
|
||||
}),
|
||||
e(Op::Session {
|
||||
offset_min: None,
|
||||
id: "s2".into(),
|
||||
book: "b".into(),
|
||||
start: 0,
|
||||
|
||||
Reference in New Issue
Block a user