Commit c80419917fc821208dae8b16702d607c89f9aee8

Authored by 常守达
1 parent 82606bcb

fix(today):修复今日HRV时间跨度

... ... @@ -67,7 +67,7 @@ class BindPartnerController extends GetxController {
void onShareMyCode() {
Share.share("""嘿 ❤️ 我发现了一个叫 DoubleFeel 的 App!
它可以帮我们互相关心 — 记录压力和睡眠、查看 HRV 与身体状态、及时了解彼此的健康状况。
快来一起使用吧 👉 https://Xxxxxxx
快来一起使用吧 👉 https://doublefeel.cn/
我的好友id:${myInviteCode.value}""");
}
... ...
... ... @@ -181,9 +181,13 @@ class TodayHrvChartCard extends StatelessWidget {
return (ts - midnight.millisecondsSinceEpoch / 1000.0);
}
/// 下一个 6h 刻度相对当天 0 点的秒数
/// 当天下一个 6h 刻度相对当天 0 点的秒数
/// 例如当前 13:58 → 下一刻度 18:00 → 返回 18 * 3600 = 64800
double _maxChartSeconds() {
if (!DateUtils.isSameDay(
controller.selectedDate.value, controller.lastSelectableDay)) {
return 24 * 3600.0;
}
final now = DateTime.now();
final secondsFromMidnight = now.hour * 3600 + now.minute * 60 + now.second;
final nextSlot = ((secondsFromMidnight / (6 * 3600)).ceil()).clamp(1, 4);
... ...