fix(app): 修复日历页日期查询参数格式 — 去除毫秒匹配后端 NaiveDateTime
This commit is contained in:
@@ -21,8 +21,13 @@ class RemoteJournalRepository implements JournalRepository {
|
||||
int? pageSize,
|
||||
}) async {
|
||||
final queryParams = <String, dynamic>{};
|
||||
if (dateFrom != null) queryParams['date_from'] = dateFrom.toIso8601String();
|
||||
if (dateTo != null) queryParams['date_to'] = dateTo.toIso8601String();
|
||||
// 后端 NaiveDateTime 格式: "2026-06-01T00:00:00"(不带毫秒)
|
||||
if (dateFrom != null) {
|
||||
queryParams['date_from'] = dateFrom.toIso8601String().replaceFirst(RegExp(r'\.\d+'), '');
|
||||
}
|
||||
if (dateTo != null) {
|
||||
queryParams['date_to'] = dateTo.toIso8601String().replaceFirst(RegExp(r'\.\d+'), '');
|
||||
}
|
||||
if (page != null) queryParams['page'] = page;
|
||||
if (pageSize != null) queryParams['page_size'] = pageSize;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user