代码优化

This commit is contained in:
DelLevin-Home
2026-06-30 15:12:11 +08:00
parent 0c7c39e641
commit 9fd80f83c8
30 changed files with 313 additions and 424 deletions

View File

@@ -10,7 +10,7 @@ const _copyWithNull = _CopyWithNullSentinel();
/// 安全解析日期字符串,失败时返回 fallback
DateTime? _safeParseDate(String? str, {DateTime? fallback}) {
if (str == null || str.isEmpty) return fallback;
return DateTime.tryParse(str) ?? fallback;
return DateTime.tryParse(str)?.toLocal() ?? fallback;
}
/// 解析字符串列表(通用工具函数,不限于 Movie