fix: incorrect time buckets and group by d-m-y

This commit is contained in:
shenlong-tanwen
2025-03-25 23:50:26 +05:30
parent 3a4e9a0129
commit c756b3584b
4 changed files with 29 additions and 140 deletions
@@ -73,9 +73,11 @@ class RenderListMonthHeaderElement extends RenderListElement {
}
class RenderListDayHeaderElement extends RenderListElement {
final String header;
late final String header;
const RenderListDayHeaderElement({required super.date, required this.header});
RenderListDayHeaderElement({required super.date}) {
header = DateFormat.yMMMMd().format(date);
}
@override
String toString() =>
@@ -16,7 +16,7 @@ class RenderListRepository with LogMixin implements IRenderListRepository {
final assetCountExp = _db.asset.id.count();
final createdTimeExp = _db.asset.createdTime;
final modifiedTimeExp = _db.asset.modifiedTime.max();
final monthYearExp = createdTimeExp.strftime('%m-%Y');
final monthYearExp = createdTimeExp.strftime('%d-%m-%Y');
final query = _db.asset.selectOnly()
..addColumns([assetCountExp, createdTimeExp, modifiedTimeExp])
@@ -40,7 +40,7 @@ class RenderListRepository with LogMixin implements IRenderListRepository {
}
return [
RenderListMonthHeaderElement(date: createdTime),
RenderListDayHeaderElement(date: createdTime),
RenderListAssetElement(
date: createdTime,
assetCount: assetCount,
@@ -63,7 +63,7 @@ class RenderListRepository with LogMixin implements IRenderListRepository {
final assetCountExp = _db.asset.id.count();
final createdTimeExp = _db.asset.createdTime;
final modifiedTimeExp = _db.asset.modifiedTime.max();
final monthYearExp = createdTimeExp.strftime('%m-%Y');
final monthYearExp = createdTimeExp.strftime('%d-%m-%Y');
final query = _db.asset.selectOnly()
..addColumns([assetCountExp, createdTimeExp, modifiedTimeExp])
@@ -86,7 +86,7 @@ class RenderListRepository with LogMixin implements IRenderListRepository {
}
return [
RenderListMonthHeaderElement(date: createdTime),
RenderListDayHeaderElement(date: createdTime),
RenderListAssetElement(
date: createdTime,
assetCount: assetCount,