feat:增加公共组件

This commit is contained in:
2025-11-22 15:19:34 +08:00
parent bc08235794
commit f5ddc4ee04
17 changed files with 1762 additions and 3 deletions

View File

@@ -11,3 +11,20 @@ String formatDateString(String date) {
String formatTime(DateTime datetime) {
return DateFormat('yyyy-MM-dd HH:mm:ss').format(datetime);
}
bool isToday(DateTime? date) {
if (date == null) return false;
final now = DateTime.now();
return date.year == now.year &&
date.month == now.month &&
date.day == now.day;
}
bool isAfterToday(DateTime? date) {
if (date == null) return false;
if (!isToday(date)) return false;
return date.isAfter(DateTime.now());
}