File tree 3 files changed +13
-5
lines changed
app/(dashboard)/(default_layout)/statistics
3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,12 @@ export const getStatsChartData = async (opts: {
26
26
userUid,
27
27
createdAt : {
28
28
gte : new Date ( from ) ,
29
- lte : new Date ( to )
29
+ lte : new Date ( '2024-12-31' )
30
30
}
31
31
} ,
32
32
include : {
33
33
question : {
34
34
select : {
35
- createdAt : true ,
36
35
tags : {
37
36
include : {
38
37
tag : true
@@ -46,7 +45,8 @@ export const getStatsChartData = async (opts: {
46
45
const data : StatsChartData = { } ;
47
46
48
47
questions . forEach ( ( answer ) => {
49
- const month = answer . question . createdAt . toISOString ( ) . slice ( 0 , 7 ) ;
48
+ console . log ( answer . createdAt ) ;
49
+ const month = answer . createdAt . toISOString ( ) . slice ( 0 , 7 ) ;
50
50
const tags = answer . question . tags . map ( ( tag ) => tag . tag . name ) ;
51
51
52
52
if ( data [ month ] ) {
@@ -63,6 +63,8 @@ export const getStatsChartData = async (opts: {
63
63
}
64
64
} ) ;
65
65
66
+ console . log ( data [ '2024-12' ] ) ;
67
+
66
68
revalidateTag ( 'statistics' ) ;
67
69
68
70
return data ;
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export default async function StatisticsPage() {
52
52
< div className = "grid grid-cols-12 gap-y-4 gap-x-8" >
53
53
{ totalQuestions ? (
54
54
< TotalStatsCard
55
+ className = "-left-3 relative"
55
56
header = { Number ( totalQuestions ) }
56
57
description = "Total Questions Answered"
57
58
/>
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export default function TotalStatsCard({
38
38
< CardHeader className = "p-3" >
39
39
< CardTitle className = "text-white" >
40
40
< div className = "flex items-center justify-between" >
41
- < span className = "text-2xl lg:text-4xl font-bold text-white " >
41
+ < span className = "text-2xl lg:text-4xl font-bold" >
42
42
{ typeof header === 'number' ? (
43
43
< NumberFlow
44
44
className = "p-0"
@@ -51,7 +51,12 @@ export default function TotalStatsCard({
51
51
</ div >
52
52
</ CardTitle >
53
53
</ CardHeader >
54
- < CardContent className = "text-white text-sm p-3 pt-0" >
54
+ < CardContent
55
+ className = { cn (
56
+ 'relative text-gray-400 text-sm p-3 pt-0' ,
57
+ typeof header === 'number' ? '-top-3' : ''
58
+ ) }
59
+ >
55
60
{ description }
56
61
</ CardContent >
57
62
</ Card >
You can’t perform that action at this time.
0 commit comments